Multibranch Pipeline: no branch checkout

15 views
Skip to first unread message

Sverre Moe

unread,
Feb 13, 2018, 7:56:23 AM2/13/18
to Jenkins Users
Multibranch Pipeline

Branch:RELEASE2
[Pipeline] checkout
Cloning the remote Git repository
Cloning with configured refspecs honoured and without tags
Cloning repository ssh://g...@git.company.com/domain/projectA.git
 
> git init /home/build/jenkins/workspace/projectA_RELEASE2-UTQNYKNJI6D4OV7ZUB2JGUXFXF4YDXHJX4HEHXPHDDEIT5DI5S3Q # timeout=10
Fetching upstream changes from ssh://g...@git.company.com/domain/projectA.git
 
> git --version # timeout=10
 
> git fetch --no-tags --progress ssh://g...@git.company.com/domain/projectA.git +refs/heads/*:refs/remotes/origin/*
 
> git config remote.origin.url ssh://g...@git.company.com/domain/projectA.git # timeout=10
 
> git config --add remote.origin.fetch +refs/heads/*:refs/remotes/origin/* # timeout=10
 > git config remote.origin.url ssh://g...@git.company.com/domain/projectA.git # timeout=10
Fetching without tags
Fetching upstream changes from ssh://g...@git.company.com/domain/projectA.git
 > git fetch --no-tags --progress ssh://g...@git.company.com/domain/projectA.git +refs/heads/*:refs/remotes/origin/*
Checking out Revision a375d22458d6954e7b0e8a8a13dc34b15e413e08 (RELEASE2)
 > git config core.sparsecheckout # timeout=10
 > git checkout -f a375d22458d6954e7b0e8a8a13dc34b15e413e08
Commit message: "Release 2.0"
 > git rev-list --no-walk a375d22458d6954e7b0e8a8a13dc34b15e413e08 # timeout=10

sh "git branch"
Running shell script
+ git branch
* (HEAD detached at a375d22)


Branch: RELEASE1
[Pipeline] checkout
Cloning the remote Git repository
Cloning with configured refspecs honoured and without tags
Cloning repository ssh://g...@git.company.com/domain/projectA.git
 
> git init /home/build/jenkins/workspace/projectA_RELEASE1-TE6AQRXIYTI74ERU56FAPKVNLHJ7LUP2YSP5CVHF3FVS2BJV5JUQ # timeout=10
Fetching upstream changes from ssh://g...@git.company.com/domain/projectA.git
 
> git --version # timeout=10
 
> git fetch --no-tags --progress ssh://g...@git.company.com/domain/projectA.git +refs/heads/*:refs/remotes/origin/*
 
> git config remote.origin.url ssh://g...@git.company.com/domain/projectA.git # timeout=10
 
> git config --add remote.origin.fetch +refs/heads/*:refs/remotes/origin/* # timeout=10
 > git config remote.origin.url ssh://g...@git.company.com/domain/projectA.git # timeout=10
Fetching without tags
Fetching upstream changes from ssh://g...@git.company.com/domain/projectA.git
 > git fetch --no-tags --progress ssh://g...@git.company.com/domain/projectA.git +refs/heads/*:refs/remotes/origin/*
Checking out Revision 285c4f454b202d7b1859b1054e691c56487a7b98 (user/RELEASE1)
 > git config core.sparsecheckout # timeout=10
 > git checkout -f 285c4f454b202d7b1859b1054e691c56487a7b98
Commit message: "Add '
Jenkinsfile' for build automation"
 > git rev-list --no-walk 285c4f454b202d7b1859b1054e691c56487a7b98 # timeout=10

sh "git branch"
Running shell script
+ git branch
* (no branch)


Running git branch should not output (no branch) on RELEASE1, but instead (HEAD detached at 285c4f4).

It is the same pipeline build script and Jenkinsfile for both branches. Anyone know what the problem here is?

The branch RELEASE1 was created from a git tag RELEASE1_BP.
To check I created a new branch from a RELEASE2 tag and that builds fine on Jenkins. So not sure whats wrong with the RELEASE1 branch.

This really has me quite perplexed.

Sverre Moe

unread,
Feb 13, 2018, 8:44:54 AM2/13/18
to Jenkins Users
Branch RELEASE1 is built on SLES 11.3 which has installed git-1.7.12.4
Branch RELEASE2 is built on SLES 12.1 which has installed git-2.12.3

If I build branch RELEASE1 on the build slave for SLES 12.1 then checkout works as expected.
Seems git version 1.7 has either a limitation or bug.
Reply all
Reply to author
Forward
0 new messages