Update Jenkinsfile

This commit is contained in:
Andrea Cavalli 2020-10-30 11:07:32 +01:00
parent 845e2aa9b3
commit aced5f3bdc

110
Jenkinsfile vendored
View File

@ -44,63 +44,69 @@ pipeline {
sh "./jenkins/scripts/generate_tdapi.sh" sh "./jenkins/scripts/generate_tdapi.sh"
} }
} }
stage("Build & Deploy SNAPSHOT") { stage("Build & Deploy") {
agent { parallel {
docker { stage("Deploy SNAPSHOT") {
image 'maven:3.6.3-openjdk-11' agent {
args '-v $HOME:/var/maven' docker {
reuseNode true 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") { stage("Release") {
agent { stage("Deploy Release") {
docker { agent {
image 'maven:3.6.3-openjdk-11' docker {
args '-v $HOME:/var/maven' image 'maven:3.6.3-openjdk-11'
reuseNode true args '-v $HOME:/var/maven'
} reuseNode true
} }
when { }
expression { params.RELEASE } when {
} expression { params.RELEASE }
steps { }
sh "git config user.email \"jenkins@mchv.eu\"" steps {
sh "git config user.name \"Jenkins\"" sh "git config user.email \"jenkins@mchv.eu\""
sh "cd ${workspace}" sh "git config user.name \"Jenkins\""
sh "git add --all || true" sh "cd ${workspace}"
sh "git commit -m \"Add generated files\" || true" sh "git add --all || true"
sh "cd tdlib; mvn -B -s $MVN_SET -Drevision=${BUILD_NUMBER} clean deploy" sh "git commit -m \"Add generated files\" || true"
sh "cd tdlight; mvn -B -s $MVN_SET -Drevision=${BUILD_NUMBER} clean deploy" 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") { stage("Publish Javadocs") {
agent { agent {
docker { docker {
image 'maven:3.6.3-openjdk-11' image 'maven:3.6.3-openjdk-11'
args '-v $HOME:/var/maven' args '-v $HOME:/var/maven'
reuseNode true 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 { post {