Skip to content

Commit b7cbfe1

Browse files
committed
cibuild: Support Jenkins
1 parent 7db49a6 commit b7cbfe1

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

cibuild

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,18 @@ bootstrap_ci_env ()
2525
VERSION=${GIT_TAG:1}
2626
BUILD=$CI_BUILD_ID
2727

28+
elif [ "$JENKINS_URL" != "" ];
29+
then
30+
say "Jenkins CI detected."
31+
# Jenkins GIT_BRANCH is like 'origin/master'
32+
GIT_BRANCH=${GIT_BRANCH#*/}
33+
GIT_COMMIT=$GIT_COMMIT
34+
BUILD=$BUILD_NUMBER
35+
VERSION=${GIT_TAG:1}
36+
# $GIT_COMMIT and $GIT_BRANCH is exported by Jenkins
37+
# https://wiki.jenkins-ci.org/display/JENKINS/Building+a+software+project
38+
# https://wiki.jenkins-ci.org/display/JENKINS/GitHub+pull+request+builder+plugin#GitHubpullrequestbuilderplugin-EnvironmentVariables
39+
2840
elif [ "$CI" = "true" ] && [ "$CIRCLECI" = "true" ];
2941
then
3042
say "Circle CI detected."
@@ -33,6 +45,8 @@ bootstrap_ci_env ()
3345
GIT_COMMIT=$CIRCLE_SHA1
3446
VERSION=${GIT_TAG:1}
3547
BUILD=$CIRCLE_BUILD_NUM
48+
else
49+
say "Unknown CI detected."
3650
fi
3751

3852
# Fallback to default values

0 commit comments

Comments
 (0)