diff --git a/Jenkinsfile b/Jenkinsfile index 2913196d..32a9c249 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -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 diff --git a/ci/Jenkinsfile.titan-iac b/ci/Jenkinsfile.titan-iac index 84e22242..aa435064 100644 --- a/ci/Jenkinsfile.titan-iac +++ b/ci/Jenkinsfile.titan-iac @@ -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