eantyshev commented on code in PR #23208:
URL: https://github.com/apache/beam/pull/23208#discussion_r991079524


##########
playground/terraform/build.gradle.kts:
##########
@@ -395,3 +372,111 @@ task("deployBackend") {
     dependsOn(deploy)
 }
 
+task("takeConfig") {
+  group = "deploy"
+  doLast {
+   var ipaddr = ""
+   var redis = ""
+   var proj = ""
+   var registry = ""
+   var ipaddrname = ""
+   var d_tag = ""
+   var stdout = ByteArrayOutputStream()
+   if (project.hasProperty("docker-tag")) {
+        d_tag = project.property("docker-tag") as String
+   }
+   exec {
+       commandLine = listOf("terraform", "output", 
"playground_static_ip_address")
+       standardOutput = stdout
+   }
+   ipaddr = stdout.toString().trim().replace("\"", "")
+   stdout = ByteArrayOutputStream()

Review Comment:
   NIT this line belongs to `exec` statement below, not above, so let's group 
it more naturally



##########
playground/terraform/build.gradle.kts:
##########
@@ -395,3 +372,111 @@ task("deployBackend") {
     dependsOn(deploy)
 }
 
+task("takeConfig") {

Review Comment:
   NIT maybe, `setHelmValues`?



##########
playground/terraform/build.gradle.kts:
##########
@@ -395,3 +372,111 @@ task("deployBackend") {
     dependsOn(deploy)
 }
 
+task("takeConfig") {
+  group = "deploy"
+  doLast {
+   var ipaddr = ""
+   var redis = ""
+   var proj = ""
+   var registry = ""
+   var ipaddrname = ""
+   var d_tag = ""
+   var stdout = ByteArrayOutputStream()
+   if (project.hasProperty("docker-tag")) {
+        d_tag = project.property("docker-tag") as String
+   }
+   exec {
+       commandLine = listOf("terraform", "output", 
"playground_static_ip_address")
+       standardOutput = stdout
+   }
+   ipaddr = stdout.toString().trim().replace("\"", "")
+   stdout = ByteArrayOutputStream()
+
+   exec {
+       commandLine = listOf("terraform", "output", "playground_redis_ip")
+       standardOutput = stdout
+   }
+   redis = stdout.toString().trim().replace("\"", "")
+   stdout = ByteArrayOutputStream()
+   exec {
+       commandLine = listOf("terraform", "output", "playground_gke_project")
+       standardOutput = stdout
+   }
+   proj = stdout.toString().trim().replace("\"", "")
+   stdout = ByteArrayOutputStream()
+   exec {
+       commandLine = listOf("terraform", "output", "docker-repository-root")
+       standardOutput = stdout
+   }
+   registry = stdout.toString().trim().replace("\"", "")
+   stdout = ByteArrayOutputStream()
+   exec {
+       commandLine = listOf("terraform", "output", 
"playground_static_ip_address_name")
+       standardOutput = stdout
+   }
+   ipaddrname = stdout.toString().trim().replace("\"", "")

Review Comment:
   NIT Do we have functions to wrap this repetitive statements?



##########
playground/terraform/build.gradle.kts:
##########
@@ -395,3 +372,111 @@ task("deployBackend") {
     dependsOn(deploy)
 }
 
+task("takeConfig") {
+  group = "deploy"
+  doLast {
+   var ipaddr = ""
+   var redis = ""
+   var proj = ""
+   var registry = ""
+   var ipaddrname = ""
+   var d_tag = ""
+   var stdout = ByteArrayOutputStream()
+   if (project.hasProperty("docker-tag")) {
+        d_tag = project.property("docker-tag") as String
+   }
+   exec {
+       commandLine = listOf("terraform", "output", 
"playground_static_ip_address")
+       standardOutput = stdout
+   }
+   ipaddr = stdout.toString().trim().replace("\"", "")
+   stdout = ByteArrayOutputStream()
+
+   exec {
+       commandLine = listOf("terraform", "output", "playground_redis_ip")
+       standardOutput = stdout
+   }
+   redis = stdout.toString().trim().replace("\"", "")
+   stdout = ByteArrayOutputStream()
+   exec {
+       commandLine = listOf("terraform", "output", "playground_gke_project")
+       standardOutput = stdout
+   }
+   proj = stdout.toString().trim().replace("\"", "")
+   stdout = ByteArrayOutputStream()
+   exec {
+       commandLine = listOf("terraform", "output", "docker-repository-root")
+       standardOutput = stdout
+   }
+   registry = stdout.toString().trim().replace("\"", "")
+   stdout = ByteArrayOutputStream()
+   exec {
+       commandLine = listOf("terraform", "output", 
"playground_static_ip_address_name")
+       standardOutput = stdout
+   }
+   ipaddrname = stdout.toString().trim().replace("\"", "")
+   stdout = ByteArrayOutputStream()

Review Comment:
   NIT seems like this isn't needed



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to