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



##########
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:
       To be honest, I don't know if this is possible. We're using ghprb plugin 
to integrate Github with Jenkins, and comments from this issue 
(https://github.com/jenkinsci/ghprb-plugin/issues/651) claim this feature 
(triggering on merging to master) is outside the scope of the plugin. That's 
why I decided to create a cron job (Website_Publish is based on a cron job too).
   
   Do you want me to continue searching for a trigger-on-merge solution? 




----------------------------------------------------------------
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:
[email protected]


Reply via email to