From aced5f3bdc35febeb40453c2845474ece1e7e641 Mon Sep 17 00:00:00 2001 From: Andrea Cavalli Date: Fri, 30 Oct 2020 11:07:32 +0100 Subject: [PATCH] Update Jenkinsfile --- Jenkinsfile | 110 +++++++++++++++++++++++++++------------------------- 1 file changed, 58 insertions(+), 52 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 7213df5..afc9f55 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -44,63 +44,69 @@ pipeline { sh "./jenkins/scripts/generate_tdapi.sh" } } - - stage("Build & Deploy SNAPSHOT") { - agent { - docker { - image 'maven:3.6.3-openjdk-11' - args '-v $HOME:/var/maven' - reuseNode true + + stage("Build & Deploy") { + parallel { + stage("Deploy SNAPSHOT") { + agent { + docker { + image 'maven:3.6.3-openjdk-11' + args '-v $HOME:/var/maven' + reuseNode true + } + } + steps { + sh "cd tdlib; mvn -s $MVN_SET -B -Ptarget-snapshot deploy" + sh "cd tdlight; mvn -s $MVN_SET -B -Ptarget-snapshot deploy" + } } - } - steps { - sh "cd tdlib; mvn -s $MVN_SET -B deploy" - sh "cd tdlight; mvn -s $MVN_SET -B deploy" - } - } - stage("Release") { - agent { - docker { - image 'maven:3.6.3-openjdk-11' - args '-v $HOME:/var/maven' - reuseNode true - } - } - when { - expression { params.RELEASE } - } - steps { - sh "git config user.email \"jenkins@mchv.eu\"" - sh "git config user.name \"Jenkins\"" - sh "cd ${workspace}" - sh "git add --all || true" - sh "git commit -m \"Add generated files\" || true" - sh "cd tdlib; mvn -B -s $MVN_SET -Drevision=${BUILD_NUMBER} clean deploy" - sh "cd tdlight; mvn -B -s $MVN_SET -Drevision=${BUILD_NUMBER} clean deploy" - } - } + stage("Release") { + stage("Deploy Release") { + agent { + docker { + image 'maven:3.6.3-openjdk-11' + args '-v $HOME:/var/maven' + reuseNode true + } + } + when { + expression { params.RELEASE } + } + steps { + sh "git config user.email \"jenkins@mchv.eu\"" + sh "git config user.name \"Jenkins\"" + sh "cd ${workspace}" + sh "git add --all || true" + sh "git commit -m \"Add generated files\" || true" + sh "cd tdlib; mvn -B -s $MVN_SET -Drevision=${BUILD_NUMBER} -Ptarget-release clean deploy" + sh "cd tdlight; mvn -B -s $MVN_SET -Drevision=${BUILD_NUMBER} -Ptarget-release clean deploy" + } + } - stage("Publish Javadocs") { - agent { - docker { - image 'maven:3.6.3-openjdk-11' - args '-v $HOME:/var/maven' - reuseNode true + stage("Publish Javadocs") { + agent { + docker { + image 'maven:3.6.3-openjdk-11' + args '-v $HOME:/var/maven' + reuseNode true + } + } + when { + expression { params.RELEASE } + } + steps { + sh "\ + cd tdlight/target-release/apidocs; \ + git remote add origin https://git.ignuranza.net/tdlight-team/tdlight-docs; \ + git add -A; \ + git commit -m \"Update javadocs\"; \ + git push --set-upstream origin master --force; \ + " + } + } } } - when { - expression { params.RELEASE } - } - steps { - sh "\ - cd tdlight/target/apidocs; \ - git remote add origin https://git.ignuranza.net/tdlight-team/tdlight-docs; \ - git add -A; \ - git commit -m \"Update javadocs\"; \ - git push --set-upstream origin master --force; \ - " - } } } post {