diff --git a/Jenkinsfile b/Jenkinsfile index 1091d87f..8688e750 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -113,13 +113,14 @@ try { /* Update packaging repo submodule */ if (release) { dir("$workDir/packaging") { try { git(url: "ssh://git@github.com/TRIQS/packaging.git", branch: env.BRANCH_NAME, credentialsId: "ssh", changelog: false) - sh "test -d ${projectName}" - sh "echo '160000 commit ${commit}\t${projectName}' | git update-index --index-info" - sh """ - git commit --author='Flatiron Jenkins ' --allow-empty -m 'Autoupdate ${projectName}' -m '${env.BUILD_TAG}' - """ // note: credentials used above don't work (need JENKINS-28335) - sh "git push origin ${env.BRANCH_NAME} || { git pull --rebase origin ${env.BRANCH_NAME} && git push origin ${env.BRANCH_NAME} ; }" + sh """#!/bin/bash -ex + dir="${projectName}" + [[ -d triqs_\$dir ]] && dir=triqs_\$dir || [[ -d \$dir ]] + echo "160000 commit ${commit}\t\$dir" | git update-index --index-info + git commit --author='Flatiron Jenkins ' --allow-empty -m 'Autoupdate ${projectName}' -m '${env.BUILD_TAG}' + git push origin ${env.BRANCH_NAME} || { git pull --rebase origin ${env.BRANCH_NAME} && git push origin ${env.BRANCH_NAME} ; } + """ } catch (err) { /* Ignore, non-critical -- might not exist on this branch */ echo "Failed to update packaging repo"