55
66import io .dagger .client .AwsCli ;
77import io .dagger .client .CacheVolume ;
8- import io .dagger .client .Client .AwsCliArguments ;
98import io .dagger .client .Container ;
109import io .dagger .client .Container .PublishArguments ;
1110import io .dagger .client .DaggerQueryException ;
@@ -114,8 +113,6 @@ public String deploy(@DefaultPath(".") Directory source, String image, String cl
114113 Secret awsAccessKeyId , Secret awsSecretAccessKey , @ Default ("eu-west-1" ) String region )
115114 throws ExecutionException , DaggerQueryException , InterruptedException {
116115 String appYaml = envsubst (source .file ("src/main/kube/app.yaml" ).contents (), "IMAGE_TAG" , image );
117- /* String appYaml = source.file("src/main/kube/app.yaml").contents()
118- .replace("${IMAGE_TAG}", image); */
119116 return kubectl (clusterName , region , awsAccessKeyId , awsSecretAccessKey )
120117 .withNewFile ("/tmp/app.yaml" , appYaml )
121118 .withExec (List .of ("kubectl" , "apply" , "-f" , "/tmp/app.yaml" ))
@@ -130,9 +127,10 @@ public String deploy(@DefaultPath(".") Directory source, String image, String cl
130127 public String getIngress (String clusterName , Secret awsAccessKeyId , Secret awsSecretAccessKey ,
131128 @ Default ("eu-west-1" ) String region )
132129 throws ExecutionException , DaggerQueryException , InterruptedException {
133- return kubectl (clusterName , region , awsAccessKeyId , awsSecretAccessKey )
134- .withExec (List .of ("kubectl" , "-n" , "devoxxfr-dagger" , "get" , "ingress" , "-o" , "jsonpath=' {.items[0].status.loadBalancer.ingress[0].hostname}' " ))
130+ String host = kubectl (clusterName , region , awsAccessKeyId , awsSecretAccessKey )
131+ .withExec (List .of ("kubectl" , "-n" , "devoxxfr-dagger" , "get" , "ingress" , "-o" , "jsonpath={.items[0].status.loadBalancer.ingress[0].hostname}" ))
135132 .stdout ();
133+ return "http://%s" .formatted (host );
136134 }
137135
138136 /** Build a ready-to-use development environment */
0 commit comments