diff --git a/Jenkinsfile b/Jenkinsfile index ae03d79..3101d2a 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -138,30 +138,30 @@ powershell -NoProfile -ExecutionPolicy Bypass -File gitea-release.ps1 } } - post { - always { - node('linux') { - cleanWs() - checkout scm +post { + always { + node('linux') { + cleanWs() + checkout scm - script { - def result = currentBuild.currentResult ?: 'UNKNOWN' + script { + def result = currentBuild.currentResult ?: 'UNKNOWN' - withCredentials([string(credentialsId: 'TAIGA_TOKEN', variable: 'TAIGA_TOKEN')]) { - sh(returnStatus: true, script: """ - set +e + withCredentials([string(credentialsId: 'TAIGA_TOKEN', variable: 'TAIGA_TOKEN')]) { + sh(returnStatus: true, script: """ + set +e - REF=\\$(git log -1 --pretty=%B | grep -oE 'TG-[0-9]+' | head -1 | cut -d- -f2 || true) + REF=\$(git log -1 --pretty=%B | grep -oE 'TG-[0-9]+' | head -1 | cut -d- -f2 || true) - if [ -z "\\$REF" ]; then - echo "No TG-* reference found" - exit 0 - fi + if [ -z "\$REF" ]; then + echo "No TG-* reference found" + exit 0 + fi - export REF - export BUILD_RESULT="${result}" + export REF + export BUILD_RESULT="${result}" - python3 - <<'PY' + python3 - <<'PY' import json import os import urllib.request @@ -229,10 +229,10 @@ except Exception as e: raise SystemExit(0) PY - """.stripIndent()) - } + """.stripIndent()) } } } } +} } \ No newline at end of file