ci(titan-iac): guard promote stage when workspace lacks .git

This commit is contained in:
codex 2026-04-19 22:58:58 -03:00
parent 6d2c72ff98
commit d4112e5a74
2 changed files with 10 additions and 0 deletions

5
Jenkinsfile vendored
View File

@ -274,6 +274,11 @@ PY
withCredentials([usernamePassword(credentialsId: 'gitea-pat', usernameVariable: 'GIT_USER', passwordVariable: 'GIT_TOKEN')]) {
sh '''
set +x
cd "${WORKSPACE}"
if [ ! -d .git ]; then
echo "workspace is not a git checkout; skipping promote"
exit 0
fi
git config user.email "jenkins@bstein.dev"
git config user.name "jenkins"
git remote set-url origin https://${GIT_USER}:${GIT_TOKEN}@scm.bstein.dev/bstein/titan-iac.git

View File

@ -273,6 +273,11 @@ PY
withCredentials([usernamePassword(credentialsId: 'gitea-pat', usernameVariable: 'GIT_USER', passwordVariable: 'GIT_TOKEN')]) {
sh '''
set +x
cd "${WORKSPACE}"
if [ ! -d .git ]; then
echo "workspace is not a git checkout; skipping promote"
exit 0
fi
git config user.email "jenkins@bstein.dev"
git config user.name "jenkins"
git remote set-url origin https://${GIT_USER}:${GIT_TOKEN}@scm.bstein.dev/bstein/titan-iac.git