Discussion:
Multibranch Pipeline: no branch checkout
Sverre Moe
2018-02-13 12:56:23 UTC
Permalink
Multibranch Pipeline

Branch:RELEASE2
[Pipeline] checkout
Cloning the remote Git repository
Cloning with configured refspecs honoured and without tags
git init /home/build/jenkins/workspace/projectA_RELEASE2-UTQNYKNJI6D4OV7ZUB2JGUXFXF4YDXHJX4HEHXPHDDEIT5DI5S3Q
# timeout=10
git --version # timeout=10
+refs/heads/*:refs/remotes/origin/*
# timeout=10
git config --add remote.origin.fetch +refs/heads/*:refs/remotes/origin/*
# timeout=10
git config remote.origin.url
ssh://***@git.company.com/domain/projectA.git # timeout=10
Fetching without tags
git fetch --no-tags --progress
ssh://***@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
git init /home/build/jenkins/workspace/projectA_RELEASE1-TE6AQRXIYTI74ERU56FAPKVNLHJ7LUP2YSP5CVHF3FVS2BJV5JUQ
# timeout=10
git --version # timeout=10
+refs/heads/*:refs/remotes/origin/*
# timeout=10
git config --add remote.origin.fetch +refs/heads/*:refs/remotes/origin/*
# timeout=10
git config remote.origin.url
ssh://***@git.company.com/domain/projectA.git # timeout=10
Fetching without tags
git fetch --no-tags --progress
ssh://***@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.
--
You received this message because you are subscribed to the Google Groups "Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-users+***@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/43215476-f923-4cf2-b754-44c743ab3371%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Sverre Moe
2018-02-13 13:44:53 UTC
Permalink
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.
Post by Sverre Moe
Multibranch Pipeline
Branch:RELEASE2
[Pipeline] checkout
Cloning the remote Git repository
Cloning with configured refspecs honoured and without tags
git init /home/build/jenkins/workspace/projectA_RELEASE2-UTQNYKNJI6D4OV7ZUB2JGUXFXF4YDXHJX4HEHXPHDDEIT5DI5S3Q
# timeout=10
Fetching upstream changes from ssh://
git --version # timeout=10
git fetch --no-tags --progress ssh://
+refs/heads/*:refs/remotes/origin/*
git config remote.origin.url ssh://
git config --add remote.origin.fetch +refs/heads/*:refs/remotes/origin/*
# timeout=10
git config remote.origin.url ssh://
Fetching without tags
Fetching upstream changes from ssh://
git fetch --no-tags --progress ssh://
+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
git init /home/build/jenkins/workspace/projectA_RELEASE1-TE6AQRXIYTI74ERU56FAPKVNLHJ7LUP2YSP5CVHF3FVS2BJV5JUQ
# timeout=10
Fetching upstream changes from ssh://
git --version # timeout=10
git fetch --no-tags --progress ssh://
+refs/heads/*:refs/remotes/origin/*
git config remote.origin.url ssh://
git config --add remote.origin.fetch +refs/heads/*:refs/remotes/origin/*
# timeout=10
git config remote.origin.url ssh://
Fetching without tags
Fetching upstream changes from ssh://
git fetch --no-tags --progress ssh://
+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.
--
You received this message because you are subscribed to the Google Groups "Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-users+***@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/f7d14c61-cdeb-4e43-a3c5-b56d00313434%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Loading...