[
https://issues.apache.org/jira/browse/BEAM-4496?focusedWorklogId=148126&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-148126
]
ASF GitHub Bot logged work on BEAM-4496:
----------------------------------------
Author: ASF GitHub Bot
Created on: 26/Sep/18 13:17
Start Date: 26/Sep/18 13:17
Worklog Time Spent: 10m
Work Description: swegner commented on a change in pull request #6431:
[BEAM-4496] Website publish via jenkins to beam asf-site branch
URL: https://github.com/apache/beam/pull/6431#discussion_r220555646
##########
File path: website/build.gradle
##########
@@ -87,20 +92,63 @@ task testWebsite(type: Exec) {
finalizedBy stopAndRemoveDockerContainer
inputs.files "$buildDir/Rakefile"
- inputs.dir "$buildDir/content"
+ inputs.dir buildContentDir
commandLine 'docker', 'exec',
"${->startDockerContainer.containerId()}", '/bin/bash', '-c',
"""cd $dockerWorkDir/build/website && \
bundle exec rake test"""
}
-/**
- * Removed testWebsite from the Beam build dependency because it is broken and
obsolete.
- * See https://issues.apache.org/jira/browse/BEAM-5367 for more info.
- */
-
-// check.dependsOn testWebsite
+check.dependsOn testWebsite
task preCommit {
dependsOn testWebsite
}
+
+// Creates a new commit on asf-site branch
+task commitWebsite << {
+ assert file("${buildContentDir}/index.html").exists()
+ // Generated javadoc and pydoc content is noa built or stored in this repo.
+ assert !file("${buildContentDir}/documentation/sdks/javadoc").exists()
+ assert !file("${buildContentDir}/documentation/sdks/pydoc").exists()
+
+ def git = grgit.open()
+ git.checkout(branch: 'asf-site')
+
+ // Delete the previous content.
+ git.remove(patterns: [ 'website/generated-content' ])
+ assert !file("${repoContentDir}/index.html").exists()
+ delete repoContentDir
+
+ // Copy the built content it and add it.
+ copy {
+ from buildContentDir
+ into repoContentDir
+ }
+ assert file("${repoContentDir}/index.html").exists()
+ git.add(patterns: ['website/generated-content'])
+
+ def latestCommit = grgit.log(maxCommits: 1)[0].abbreviatedId
+ def currentDate = new Date().format('yyyy/MM/dd HH:mm:ss')
+ String message = "Publishing website ${currentDate} at commit
${latestCommit}"
+ git.commit(message: message)
+}
+
+// Pushes the asf-site branch commits.
+task publishWebsite << {
+ def git = grgit.open()
+ git.checkout(branch: 'asf-site')
+ // Cannot authenticate to the default github uri, so specify gitbox.
+ exec {
+ executable 'sh'
+ args '-c', "git remote set-url origin
https://gitbox.apache.org/repos/asf/beam.git"
Review comment:
What about adding a separate remote named something that is less likely to
muck up local config (i.e. `gitbox`), in case this gets run locally.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
Issue Time Tracking
-------------------
Worklog Id: (was: 148126)
> Create Jenkins job to push generated HTML to asf-site branch
> ------------------------------------------------------------
>
> Key: BEAM-4496
> URL: https://issues.apache.org/jira/browse/BEAM-4496
> Project: Beam
> Issue Type: Sub-task
> Components: build-system, website
> Reporter: Scott Wegner
> Assignee: Alan Myrvold
> Priority: Major
> Labels: beam-site-automation-reliability
> Time Spent: 17h
> Remaining Estimate: 0h
>
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)