Skip to content

Commit

Permalink
Merge pull request #7 from ThomasDelteil/new_website_pipeline_2_aaron
Browse files Browse the repository at this point in the history
pr validation functions for website
  • Loading branch information
aaronmarkham authored Aug 15, 2019
2 parents 209222a + 64b9aac commit f364c8b
Show file tree
Hide file tree
Showing 4 changed files with 88 additions and 2 deletions.
23 changes: 23 additions & 0 deletions ci/jenkins/Jenkins_steps.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -1545,6 +1545,29 @@ def docs_prepare() {
}


// This is for the website and the Python API only
def docs_prepare_python_only() {
return ['Prepare for publication of the full website': {
node(NODE_LINUX_CPU) {
ws('workspace/docs') {
timeout(time: max_time, unit: 'MINUTES') {
utils.init_git()

unstash 'jekyll-artifacts'
unstash 'python-artifacts'

// Prepare website and Python API docs
utils.docker_run('ubuntu_cpu_jekyll', 'build_docs_small', false)

// Publish preview to S3
sh "cd docs/_build/html && ci/other/ci_deploy_doc.sh ${env.BRANCH_NAME} ${env.BUILD_NUMBER}"
}
}
}
}]
}


def docs_archive() {
return ['Archive the full website': {
node(NODE_LINUX_CPU) {
Expand Down
2 changes: 1 addition & 1 deletion ci/jenkins/Jenkinsfile_website_full
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ core_logic: {

utils.parallel_stage('Prepare', [
custom_steps.docs_prepare(),
custom_setup.docs_archive()
custom_steps.docs_archive()
])

utils.parallel_stage('Publish', [
Expand Down
63 changes: 63 additions & 0 deletions ci/jenkins/Jenkinsfile_website_full_pr
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
// -*- mode: groovy -*-

// 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.
//
// Jenkins pipeline
// See documents at https://jenkins.io/doc/book/pipeline/jenkinsfile/

// timeout in minutes
max_time = 180

node('utility') {
// Loading the utilities requires a node context unfortunately
checkout scm
utils = load('ci/Jenkinsfile_utils.groovy')
custom_steps = load('ci/jenkins/Jenkins_steps.groovy')
}
utils.assign_node_labels(utility: 'utility', linux_cpu: 'mxnetlinux-cpu')

utils.main_wrapper(
core_logic: {
utils.parallel_stage('Build', [
custom_steps.compile_unix_lite()
])

utils.parallel_stage('Build Docs', [
custom_steps.docs_jekyll(),
custom_steps.docs_c(),
custom_steps.docs_python(),
custom_steps.docs_julia(),
//custom_steps.docs_r(),
custom_steps.docs_scala(),
custom_steps.docs_java(),
custom_steps.docs_clojure()
])

utils.parallel_stage('Prepare & Publish Preview', [
custom_steps.docs_prepare_python_only()
])

}
,
failure_handler: {
// Only send email if master or release branches failed
if (currentBuild.result == "FAILURE" && (env.BRANCH_NAME == "master" || env.BRANCH_NAME.startsWith("v"))) {
emailext body: 'Build for MXNet branch ${BRANCH_NAME} has broken. Please view the build at ${BUILD_URL}', replyTo: '${EMAIL}', subject: '[BUILD FAILED] Branch ${BRANCH_NAME} build ${BUILD_NUMBER}', to: '${EMAIL}'
}
}
)
2 changes: 1 addition & 1 deletion ci/other/ci_deploy_doc.sh
Original file line number Diff line number Diff line change
Expand Up @@ -28,5 +28,5 @@
#
set -ex

aws s3 sync --delete docs/_build/ s3://mxnet-ci-doc/$1/$2 \
aws s3 sync --delete . s3://mxnet-ci-doc/$1/$2 \
&& echo "Doc is hosted at http://mxnet-ci-doc.s3-accelerate.dualstack.amazonaws.com/$1/$2/index.html"

0 comments on commit f364c8b

Please sign in to comment.