From 6de8a7543368dd66eec04769f56bf3f6fb835fda Mon Sep 17 00:00:00 2001 From: Sean Busbey Date: Tue, 11 Aug 2020 22:48:13 -0500 Subject: [PATCH] HBASE-24869 migrate website generation to new asf jenkins closes #2246 Signed-off-by: Duo Zhang --- .../generate-hbase-website.Jenkinsfile | 79 +++++++++++++++++++ 1 file changed, 79 insertions(+) create mode 100644 dev-support/jenkins-scripts/generate-hbase-website.Jenkinsfile diff --git a/dev-support/jenkins-scripts/generate-hbase-website.Jenkinsfile b/dev-support/jenkins-scripts/generate-hbase-website.Jenkinsfile new file mode 100644 index 00000000000..76b7d3d4140 --- /dev/null +++ b/dev-support/jenkins-scripts/generate-hbase-website.Jenkinsfile @@ -0,0 +1,79 @@ +// 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. +pipeline { + agent { + node { + label 'git-websites' + } + } + triggers { + pollSCM('@daily') + } + options { + buildDiscarder(logRotator(numToKeepStr: '30')) + timeout (time: 1, unit: 'HOURS') + timestamps() + skipDefaultCheckout() + disableConcurrentBuilds() + } + parameters { + booleanParam(name: 'DEBUG', defaultValue: false, description: 'Produce a lot more meta-information.') + booleanParam(name: 'FORCE_FAIL', defaultValue: false, description: 'force a failure to test notifications.') + } + stages { + stage ('generate hbase website') { + tools { + maven 'Maven (latest)' + // this needs to be set to the jdk that ought to be used to build releases on the branch the Jenkinsfile is stored in. + jdk "JDK 1.8 (latest)" + } + steps { + dir('hbase') { + checkout scm + } + sh '''#!/usr/bin/env bash + set -e + if [ "${DEBUG}" = "true" ]; then + set -x + fi + if [ "${FORCE_FAIL}" = "true" ]; then + false + fi + bash hbase/dev-support/jenkins-scripts/generate-hbase-website.sh --working-dir "${WORKSPACE}" --publish hbase +''' + } + } + } + post { + always { + // Has to be relative to WORKSPACE. + archiveArtifacts artifacts: '*.patch.zip,hbase-*.txt' + } + failure { + mail to: 'dev@hbase.apache.org', replyTo: 'dev@hbase.apache.org', subject: "Failure: HBase Generate Website", body: """ +Build status: ${currentBuild.currentResult} + +The HBase website has not been updated to incorporate recent HBase changes. + +See ${env.BUILD_URL}console +""" + } + cleanup { + deleteDir() + } + } +}