This is an automated email from the ASF dual-hosted git repository. zregvart pushed a commit to branch website in repository https://gitbox.apache.org/repos/asf/camel.git
commit 57c86ef04275c66a1f4fd6e541c3ec85642cf2ea Author: Zoran Regvart <zregv...@apache.org> AuthorDate: Tue Jul 17 12:01:34 2018 +0200 Test website Jenkinsfile --- Jenkinsfile | 94 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 89 insertions(+), 5 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index a34301d..9a76ec9 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -17,18 +17,16 @@ * under the License. */ +def BUILD_WEBSITE = !'false'.equalsIgnoreCase(env.BUILD_WEBSITE) def LOCAL_REPOSITORY = env.LOCAL_REPOSITORY ?: '/home/jenkins/jenkins-slave/maven-repositories/0' def AGENT_LABEL = env.AGENT_LABEL ?: 'ubuntu' +def WEBSITE_AGENT_LABEL = env.WEBSITE_AGENT_LABEL ?: 'git-websites' def JDK_NAME = env.JDK_NAME ?: 'JDK 1.8 (latest)' def MAVEN_PARAMS = "-U -B -e -fae -V -Dmaven.repo.local=${LOCAL_REPOSITORY} -Dnoassembly -Dmaven.compiler.fork=true -Dsurefire.rerunFailingTestsCount=2" pipeline { - agent { - label AGENT_LABEL - } - tools { jdk JDK_NAME } @@ -42,27 +40,99 @@ pipeline { stages { + stage('Website') { + when { + beforeAgent true + expression { BUILD_WEBSITE } + anyOf { + changeset "**/*.adoc" + changeset "camel-website/**" + } + } + + agent { + node { + label WEBSITE_AGENT_LABEL + } + } + + options { + skipDefaultCheckout() + } + + steps { + dir('camel') { + checkout scm + sh "./mvnw -U -B -V -f camel-website" + } + + dir('site') { +/* checkout [ branches: [name: 'asf-site'] ] + sh "cp -R ../camel/camel-website/public/* ." + sh "git add ."*/ + } + } + } + stage('Build & Deploy') { + agent { + label AGENT_LABEL + } + when { + beforeAgent true branch 'master' + not { + anyOf { + changeset "**/*.adoc" + changeset "camel-website/**" + } + } } + steps { sh "./mvnw $MAVEN_PARAMS -Dmaven.test.skip.exec=true clean deploy" } } stage('Build') { + agent { + label AGENT_LABEL + } + when { + beforeAgent true not { - branch 'master' + allOf { + branch 'master' + anyOf { + changeset "**/*.adoc" + changeset "camel-website/**" + } + } } } + steps { sh "./mvnw $MAVEN_PARAMS -Dmaven.test.skip.exec=true clean install" } } stage('Checks') { + agent { + label AGENT_LABEL + } + + when { + beforeAgent true + not { + anyOf { + changeset "**/*.adoc" + changeset "camel-website/**" + } + } + } + steps { sh "./mvnw $MAVEN_PARAMS -Psourcecheck -Dcheckstyle.failOnViolation=false checkstyle:check" } @@ -74,6 +144,20 @@ pipeline { } stage('Test') { + agent { + label AGENT_LABEL + } + + when { + beforeAgent true + not { + anyOf { + changeset "**/*.adoc" + changeset "camel-website/**" + } + } + } + steps { sh "./mvnw $MAVEN_PARAMS -Dmaven.test.failure.ignore=true test" }