[
https://issues.apache.org/jira/browse/BEAM-4495?focusedWorklogId=139406&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-139406
]
ASF GitHub Bot logged work on BEAM-4495:
----------------------------------------
Author: ASF GitHub Bot
Created on: 29/Aug/18 19:55
Start Date: 29/Aug/18 19:55
Worklog Time Spent: 10m
Work Description: pabloem commented on a change in pull request #6282:
[BEAM-4495] Website pre-commit job
URL: https://github.com/apache/beam/pull/6282#discussion_r213770593
##########
File path: website/build.gradle
##########
@@ -0,0 +1,99 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * License); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+// Define common lifecycle tasks and artifact types
+apply plugin: "base"
+
+def dockerImageTag = 'beam-website'
+def dockerWorkDir = "/repo"
+def buildDir = "$project.rootDir/build/website"
+
+task buildDockerImage(type: Exec) {
+ inputs.files 'Gemfile', 'Gemfile.lock'
+ commandLine 'docker', 'build', '-t', dockerImageTag, '.'
+}
+
+task createDockerContainer(type: Exec) {
+ dependsOn buildDockerImage
+ standardOutput = new ByteArrayOutputStream()
+ ext.containerId = {
+ return standardOutput.toString().trim()
+ }
+ commandLine '/bin/bash', '-c',
+ "docker create -v $project.rootDir:$dockerWorkDir -u \$(id -u):\$(id -g)
$dockerImageTag"
+}
+
+task startDockerContainer(type: Exec) {
+ dependsOn createDockerContainer
+ ext.containerId = {
+ return createDockerContainer.containerId()
+ }
+ commandLine 'docker', 'start',
+ "${->createDockerContainer.containerId()}" // Lazily evaluate containerId.
+}
+
+task stopAndRemoveDockerContainer(type: Exec) {
+ commandLine 'docker', 'rm', '-f', "${->createDockerContainer.containerId()}"
+}
+
+task setupBuildDir(type: Copy) {
+ from('.') {
+ include 'Gemfile*'
+ include 'Rakefile'
+ }
+ into buildDir
+}
+
+task cleanWebsite(type: Delete) {
+ delete buildDir
+}
+clean.dependsOn cleanWebsite
+
+task buildWebsite(type: Exec) {
+ dependsOn startDockerContainer, setupBuildDir
+ finalizedBy stopAndRemoveDockerContainer
+ inputs.files 'Gemfile.lock', '_config.yml'
+ inputs.dir 'src'
+ outputs.dir "$buildDir/.sass-cache"
+ outputs.dir "$buildDir/content"
+ commandLine 'docker', 'exec', '-w', "$dockerWorkDir/build/website",
+ "${->startDockerContainer.containerId()}", '/bin/bash', '-c',
+ """bundle exec jekyll build \
+ --config $dockerWorkDir/website/_config.yml \
+ --incremental \
+ --source $dockerWorkDir/website/src
+ """
+}
+build.dependsOn buildWebsite
+
+task testWebsite(type: Exec) {
+ dependsOn startDockerContainer, buildWebsite
Review comment:
`buildWebsite` already depends on `startDockerContainer`. Is there a reason
why we can't remove `startDockerContainer` from here?
----------------------------------------------------------------
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: 139406)
Time Spent: 5h 10m (was: 5h)
> Create website pre-commits for apache/beam repository
> -----------------------------------------------------
>
> Key: BEAM-4495
> URL: https://issues.apache.org/jira/browse/BEAM-4495
> Project: Beam
> Issue Type: Sub-task
> Components: testing, website
> Reporter: Scott Wegner
> Assignee: Udi Meiri
> Priority: Major
> Labels: beam-site-automation-reliability
> Time Spent: 5h 10m
> Remaining Estimate: 0h
>
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)