@script runs with a different branch

23 views
Skip to first unread message

Dave LeBlanc

unread,
Jan 18, 2017, 11:22:12 AM1/18/17
to Jenkins Users
Hi folks, having a heck of a time setting up my new Jenkins instance here. I'm using the newest 2.40 build with the newest plugins and the pipeline style, and I think I mostly have the github hook stuff in place, the only issue being:

  When I push a branch (test-branch), the github hook is called appropriately, and I see a build kicked off. The workspace/TestBranch directory is on the expected version (HEAD of test-branch), but workspace/TestBranch@script is on an ancient unrelated branch (HEAD of some odd branch). Very odd.

Any ideas on how to fix this? Is "**" as the branch specifier ok?

P.S. - Is it ok to watch multiple branches (eg: per-feature) and expect Jenkins to build and report on them appropriately?

Cheers,

 -Dave

Dave LeBlanc

unread,
Jan 18, 2017, 12:18:44 PM1/18/17
to Jenkins Users
Small correction - the @script is at the proper version, but the main workspace is on the odd branch.

The main build info screen says:

Revision: 116ec7be055b760122bc2ae310622fc7c91df5fe origin/dml/jenkins-testing

Revision: 97a1e48ebb50c62ff5fce3a69e789ff236fd79fd origin/dml/other-unrelated-branch

Why would it report two revisions? 


After starting this build, the main workspace is at:
    * (detached from 97a1e48)
Which is from Jul 25 of 2016! - it's the origin/dml/other-unrelated-branch above

And the @script workspace is at:
    * (detached from 116ec7b)
Which is the head of dml/jenkins-testing - which is what I expect.


Here's the hook log, I did a manual "build now", but pushing to github seems to act the same way.

Started on Jan 18, 2017 8:30:57 AM
Using strategy: Default
[poll] Last Built Revision: Revision 0454a42322bedae04c1682cd394c3a915f32294e (origin/dml/jenkins-testing)
 > git rev-parse --is-inside-work-tree # timeout=10
Fetching changes from the remote Git repositories
 > git config remote.origin.url g...@github.com:dleblanc/JAVA-BACKEND.git # timeout=10
Fetching upstream changes from g...@github.com:dleblanc/JAVA-BACKEND.git
 > git --version # timeout=10
 > git fetch --tags --progress g...@github.com:dleblanc/JAVA-BACKEND.git +refs/heads/*:refs/remotes/origin/*
Polling for changes in
...
Seen branch in repository origin/dml/jenkins-testing
...
Seen 90 remote branches
Using strategy: Default
[poll] Last Built Revision: Revision 0454a42322bedae04c1682cd394c3a915f32294e (origin/dml/jenkins-testing)
 > git rev-parse --is-inside-work-tree # timeout=10
Fetching changes from the remote Git repositories
 > git config remote.origin.url g...@github.com:dleblanc/JAVA-BACKEND.git # timeout=10
Fetching upstream changes from g...@github.com:dleblanc/JAVA-BACKEND.git
 > git --version # timeout=10
 > git fetch --tags --progress g...@github.com:dleblanc/JAVA-BACKEND.git +refs/heads/*:refs/remotes/origin/*
Polling for changes in
...
Seen branch in repository origin/dml/jenkins-testing
... Seen 86 remote branches Done. Took 2.7 sec No changes

Dave LeBlanc

unread,
Jan 23, 2017, 11:59:41 AM1/23/17
to Jenkins Users
After more googling, it appears it's a known issue with slashes in the branch name: https://issues.jenkins-ci.org/browse/JENKINS-37263

I've used the workaround described in the bug post, and that appears to have solved it for now.
Reply all
Reply to author
Forward
0 new messages