You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@beam.apache.org by GitBox <gi...@apache.org> on 2020/05/27 03:54:19 UTC

[GitHub] [beam] Ardagan commented on a change in pull request #11816: [BEAM-5863] Jenkins job to deploy Beam Metrics infrastructure automatically upon code changes

Ardagan commented on a change in pull request #11816:
URL: https://github.com/apache/beam/pull/11816#discussion_r430630493



##########
File path: .test-infra/metrics/build_and_publish_containers.sh
##########
@@ -36,8 +33,8 @@ fi
 
 echo
 echo ===========Start==========
-CONTAINER_VERSION_NAME=$1
-DO_PUSH=$2
+DO_PUSH=$1
+CONTAINER_VERSION_NAME=${2:-latest}

Review comment:
       will latest overwrite container image version? If not, we should add cleanup script for old versions.

##########
File path: .test-infra/metrics/build.gradle
##########
@@ -50,9 +51,49 @@ dockerCompose {
 
 dockerCompose.isRequiredBy(testMetricsStack)
 
-task preCommit { dependsOn testMetricsStack }
+task validateConfiguration(type: Exec) {
+  commandLine 'sh', '-c', 'kubectl apply --dry-run=true -Rf kubernetes'
+}
+
+task preCommit {
+  dependsOn validateConfiguration
+  dependsOn testMetricsStack
+}
+
+task buildAndPublishContainers(type: Exec) {
+  commandLine './build_and_publish_containers.sh', 'true'
+}
+
+// Applies new configuration to all resources labeled with `app=beammetrics`
+// and forces Kubernetes to re-pull images.
+task applyConfiguration() {
+  doLast {
+    assert grgit : 'Cannot use outside of git repository'
+
+    def git = grgit.open()
+    def commitedChanges = git.log(paths: ['.test-infra/metrics']).findAll {
+      it.dateTime > ZonedDateTime.now().minusHours(6)

Review comment:
       Is there a reason to detect timee vs automatic job trigger by commit to master with relevant folder?




----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org