beam-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sc...@apache.org
Subject [beam] branch master updated: [BEAM-4496] Fix branch fetch failure on job_PostCommit_Website_Publish (#6505)
Date Sat, 29 Sep 2018 21:33:35 GMT
This is an automated email from the ASF dual-hosted git repository.

scott pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/beam.git


The following commit(s) were added to refs/heads/master by this push:
     new bf69c25  [BEAM-4496] Fix branch fetch failure on job_PostCommit_Website_Publish (#6505)
bf69c25 is described below

commit bf69c2533fb6eb8897855187b95b4cca76eb8c98
Author: Alan Myrvold <alan.myrvold@comcast.net>
AuthorDate: Sat Sep 29 17:33:29 2018 -0400

    [BEAM-4496] Fix branch fetch failure on job_PostCommit_Website_Publish (#6505)
---
 website/build.gradle | 30 +++++++++++++-----------------
 1 file changed, 13 insertions(+), 17 deletions(-)

diff --git a/website/build.gradle b/website/build.gradle
index 7d22492..a73628d 100644
--- a/website/build.gradle
+++ b/website/build.gradle
@@ -29,6 +29,14 @@ def buildContentDir = "${project.rootDir}/build/website/generated-content"
 def repoContentDir = "${project.rootDir}/website/generated-content"
 def commitedChanges = false
 
+def shell = { cmd ->
+  println cmd
+  exec {
+    executable 'sh'
+    args '-c', cmd
+  } 
+}
+
 task buildDockerImage(type: Exec) {
   inputs.files 'Gemfile', 'Gemfile.lock'
   commandLine 'docker', 'build', '-t', dockerImageTag, '.'
@@ -116,7 +124,10 @@ task commitWebsite << {
   def git = grgit.open()
   // get the latest commit on master
   def latestCommit = grgit.log(maxCommits: 1)[0].abbreviatedId
+
+  shell "git fetch origin asf-site"
   git.checkout(branch: 'asf-site')
+  shell "git reset --hard origin/asf-site"
 
   // Delete the previous content.
   git.remove(patterns: [ 'website/generated-content' ])
@@ -142,7 +153,6 @@ task commitWebsite << {
   }
 }
 
-
 /*
  * Pushes the asf-site branch commits.
  *
@@ -166,23 +176,9 @@ task publishWebsite << {
     println 'No changes to push'
     return
   }
-  if (!git.remote.list().find { it.name == 'website-publish' }) {
-    println "Adding website-publish remote"
-    // Cannot authenticate to the default github uri, so specify gitbox.
-    git.remote.add(name: 'website-publish',
-                   url: 'https://gitbox.apache.org/repos/asf/beam.git',
-                   pushRefSpecs: ['refs/heads/asf-site'])
-  }
+
   // Because git.push() fails to authenticate, run git push directly.
-  exec {
-    executable 'sh'
-    args '-c', "git push website-publish asf-site"
-  } 
-  // Remove the remote. grgit does not have a remote.remove method.
-  exec {
-    executable 'sh'
-    args '-c', "git remote remove website-publish"
-  }
+  shell "git push https://gitbox.apache.org/repos/asf/beam.git asf-site"
 }
 
 commitWebsite.dependsOn testWebsite


Mime
View raw message