Skip to content

Commit 79e8f5c

Browse files
committed
fix: remove envsubst in deploy function
Signed-off-by: Jean-Christophe Sirot <jcsirot@gmail.com>
1 parent b981b47 commit 79e8f5c

File tree

1 file changed

+3
-5
lines changed
  • ci/src/main/java/io/dagger/modules/ci

1 file changed

+3
-5
lines changed

ci/src/main/java/io/dagger/modules/ci/Ci.java

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -107,19 +107,17 @@ public String publish(@DefaultPath(".") Directory source, Secret awsAccessKeyId,
107107
public String deploy(@DefaultPath(".") Directory source, String image, Secret awsAccessKeyId, Secret awsSecretAccessKey)
108108
throws ExecutionException, DaggerQueryException, InterruptedException {
109109
Container deployerCtr = dag.container().from("alpine")
110-
.withExec(List.of("apk", "add", "envsubst", "aws-cli", "curl"))
110+
.withExec(List.of("apk", "add", "aws-cli", "curl"))
111111
.withExec(List.of("curl", "-L", "-o", "kubectl", "https://dl.k8s.io/release/v1.31.0/bin/linux/arm64/kubectl"))
112112
.withExec(List.of("chmod", "+x", "kubectl"))
113113
.withExec(List.of("mv", "kubectl", "/usr/local/bin/"));
114+
String appYaml = source.file("src/main/kube/app.yaml").contents().replace("${IMAGE_TAG}", image);
114115
return dag.awsCli(new AwsCliArguments().withContainer(deployerCtr))
115116
.withRegion("eu-west-1")
116117
.withStaticCredentials(awsAccessKeyId, awsSecretAccessKey)
117118
.exec(List.of("eks", "update-kubeconfig", "--name", "confused-classical-sheepdog"))
118119
.withEnvVariable("IMAGE_TAG", image)
119-
.withDirectory("/src", source)
120-
.withExec(List.of("envsubst"), new WithExecArguments()
121-
.withStdin(source.file("src/main/kube/app.yaml").contents())
122-
.withRedirectStdout("/tmp/app.yaml"))
120+
.withNewFile("/tmp/app.yaml", appYaml)
123121
.withExec(List.of("kubectl", "apply", "-f", "/tmp/app.yaml"))
124122
.stdout();
125123
}

0 commit comments

Comments
 (0)