Skip to content

Commit be54ef9

Browse files
fix(Jenkinsfile): lookup branch from commit SHA (#116)
Jenkins checks out the exact commit, not the branch, which broke the previous method
1 parent ad4e70c commit be54ef9

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

Jenkinsfile

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -64,12 +64,12 @@ parallel(
6464

6565
// HACK: Recommended approach for getting command output is writing to and then reading a file.
6666
sh 'mkdir -p tmp'
67-
sh 'git rev-parse --abbrev-ref HEAD > tmp/GIT_BRANCH'
67+
sh 'git describe --all --exact-match > tmp/GIT_BRANCH'
6868
sh 'git tag -l --contains HEAD > tmp/GIT_TAG'
6969
def git_branch = readFile('tmp/GIT_BRANCH')
7070
def git_tag = readFile('tmp/GIT_TAG')
7171

72-
if (git_branch != "master" && git_tag == "") {
72+
if (git_branch != "heads/master" && git_tag == "") {
7373
echo "Skipping build of 386 binaries to shorten CI for Pull Requests"
7474
env.BUILD_ARCH = "amd64"
7575
}
@@ -91,10 +91,10 @@ parallel(
9191

9292
// HACK: Recommended approach for getting command output is writing to and then reading a file.
9393
sh 'mkdir -p tmp'
94-
sh 'git rev-parse --abbrev-ref HEAD > tmp/GIT_BRANCH'
94+
sh 'git describe --all --exact-match > tmp/GIT_BRANCH'
9595
def git_branch = readFile('tmp/GIT_BRANCH')
9696

97-
if (git_branch == "master") {
97+
if (git_branch == "heads/master") {
9898
sh 'make bootstrap'
9999
sh 'make build-latest'
100100

0 commit comments

Comments
 (0)