Skip to content

Commit 0f6c001

Browse files
BUILD-4657: fix promote step
Signed-off-by: Jayadeep Kinavoor Madam <[email protected]>
1 parent 94c2d78 commit 0f6c001

File tree

2 files changed

+41
-1
lines changed

2 files changed

+41
-1
lines changed

.cirrus.yml

+3-1
Original file line numberDiff line numberDiff line change
@@ -54,4 +54,6 @@ promote_task:
5454
GITHUB_TOKEN: VAULT[development/github/token/${CIRRUS_REPO_OWNER}-${CIRRUS_REPO_NAME}-promotion token]
5555
ARTIFACTS: sonar-summy-python-oss
5656
<<: *POETRY_TEMPLATE
57-
promote_script: .cirrus/cirrus_promote_python
57+
promote_script:
58+
- source .cirrus/cirrus-env PROMOTE
59+
- .cirrus/cirrus_promote_python

.cirrus/cirrus_env

+38
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
#!/bin/bash
2+
3+
set +o verbose
4+
set -euo pipefail
5+
6+
# generic environment variables used by Gradle build
7+
export GIT_SHA1=$CIRRUS_CHANGE_IN_REPO
8+
export GITHUB_BASE_BRANCH=${CIRRUS_BASE_BRANCH:-}
9+
export GITHUB_BRANCH=$CIRRUS_BRANCH
10+
export GITHUB_REPO=${CIRRUS_REPO_FULL_NAME}
11+
export PROJECT=${CIRRUS_REPO_NAME}
12+
export PULL_REQUEST=${CIRRUS_PR:-false}
13+
export PULL_REQUEST_SHA=${CIRRUS_BASE_SHA:-}
14+
# used by burgr to identify stages of the pipeline
15+
export PIPELINE_ID=${CIRRUS_BUILD_ID}
16+
17+
export LANG=C.UTF-8
18+
19+
TASK_TYPE=$1
20+
if [[ "$TASK_TYPE" != "BUILD"* ]]; then
21+
export SONARSOURCE_QA=true
22+
fi
23+
24+
: "${CI_BUILD_NUMBER?missing parameter. See https://xtranet-sonarsource.atlassian.net/wiki/spaces/RE/pages/2992210934}"
25+
BUILD_NUMBER=${CI_BUILD_NUMBER}
26+
BUILD_ID=${CI_BUILD_NUMBER}
27+
echo "BUILD_NUMBER: $BUILD_NUMBER"
28+
export BUILD_NUMBER BUILD_ID
29+
30+
if [[ "${GITHUB_TOKEN:-}" == "ENCRYPTED"* ]]; then
31+
echo "Unsetting GITHUB_TOKEN"
32+
unset GITHUB_TOKEN
33+
fi
34+
35+
case $BUILD_ID in
36+
''|*[!0-9]*) echo "$BUILD_ID is not a number" && exit 1 ;;
37+
esac
38+
set -o verbose

0 commit comments

Comments
 (0)