3
0
mirror of https://github.com/triqs/dft_tools synced 2024-06-02 11:25:29 +02:00

[jenkins] try a more robust git push

This commit is contained in:
Dylan Simon 2018-12-04 13:50:12 -05:00 committed by Nils Wentzell
parent 96c085a69f
commit 203783ceba

4
Jenkinsfile vendored
View File

@ -97,7 +97,7 @@ try {
git commit --author='Flatiron Jenkins <jenkins@flatironinstitute.org>' --allow-empty -m 'Generated documentation for ${subdir}' -m '${env.BUILD_TAG} ${commit}' git commit --author='Flatiron Jenkins <jenkins@flatironinstitute.org>' --allow-empty -m 'Generated documentation for ${subdir}' -m '${env.BUILD_TAG} ${commit}'
""" """
// note: credentials used above don't work (need JENKINS-28335) // note: credentials used above don't work (need JENKINS-28335)
sh "git push origin master" sh "git push origin master || { git pull --rebase origin master && git push origin master ; }"
} }
dir("$workDir/docker") { try { dir("$workDir/docker") { try {
git(url: "ssh://git@github.com/TRIQS/docker.git", branch: env.BRANCH_NAME, credentialsId: "ssh", changelog: false) git(url: "ssh://git@github.com/TRIQS/docker.git", branch: env.BRANCH_NAME, credentialsId: "ssh", changelog: false)
@ -106,7 +106,7 @@ try {
git commit --author='Flatiron Jenkins <jenkins@flatironinstitute.org>' --allow-empty -m 'Autoupdate ${projectName}' -m '${env.BUILD_TAG}' git commit --author='Flatiron Jenkins <jenkins@flatironinstitute.org>' --allow-empty -m 'Autoupdate ${projectName}' -m '${env.BUILD_TAG}'
""" """
// note: credentials used above don't work (need JENKINS-28335) // note: credentials used above don't work (need JENKINS-28335)
sh "git push origin ${env.BRANCH_NAME}" sh "git push origin ${env.BRANCH_NAME} || { git pull --rebase origin ${env.BRANCH_NAME} && git push origin ${env.BRANCH_NAME} ; }"
} catch (err) { } catch (err) {
echo "Failed to update docker repo" echo "Failed to update docker repo"
} } } }