I've tried this on Jenkins 2.19.1 and 2.25 (both on Windows installed with 
the MSI), but I'm having the same problem. Is there another Git 
configuration I need to set somewhere? 

My goal is to create a job that builds my dmz branch, then automatically 
merges it into my master branch. I can get the dmz branch to build with the 
trick I've outlined below, however the merge command throws errors that 
origin/master doesn't exist, so I'm wondering if the issues are related.

The main repo is GitLabs Enterprise Edition. I did a default install 
jenkins and added my SSH key to connect to GitLabs.

1. Create New Freestyle Job
2. Add Repo URL
3. Set credentials

There is a Branch Specifier already set by default with a value of 
"*/master"

4. Save the config and run the build. Fails: 

 > C:\Program Files\Git\cmd\git.exe fetch --tags 
 > g...@gitlab.mkmeier.com:msn/gitgud.git +refs/heads/*:refs/remotes/origin/*

 > C:\Program Files\Git\cmd\git.exe config remote.origin.url 
 > g...@gitlab.mkmeier.com:msn/gitgud.git # timeout=10

 > C:\Program Files\Git\cmd\git.exe config --add remote.origin.fetch 
 > +refs/heads/*:refs/remotes/origin/* # timeout=10

 > C:\Program Files\Git\cmd\git.exe config remote.origin.url 
 > g...@gitlab.mkmeier.com:msn/gitgud.git # timeout=10

Fetching upstream changes from g...@gitlab.mkmeier.com:msn/gitgud.git

 > C:\Program Files\Git\cmd\git.exe --version # timeout=10

using GIT_SSH to set credentials SSH Key for GitLabs

 > C:\Program Files\Git\cmd\git.exe fetch --tags 
 > g...@gitlab.mkmeier.com:msn/gitgud.git +refs/heads/*:refs/remotes/origin/*

 > C:\Program Files\Git\cmd\git.exe rev-parse 
 > "refs/remotes/origin/master^{commit}" # timeout=10

 > C:\Program Files\Git\cmd\git.exe rev-parse 
 > "refs/remotes/origin/origin/master^{commit}" # timeout=10

 > C:\Program Files\Git\cmd\git.exe rev-parse "origin/master^{commit}" # 
 > timeout=10

ERROR: Couldn't find any revision to build. Verify the repository and branch 
configuration for this job.

Finished <http://stacktrace.jenkins-ci.org/search?query=Finished>: FAILURE



5. Open config

6. Under branches to build click "Add Branch"

7. Copy/paste "*/master" from the existing Branch Specifier (now there are two 
identical Branch Specifiers in the config)

8. Save and Run the build: Success!!


 > C:\Program Files\Git\cmd\git.exe fetch --tags 
 > g...@gitlab.mkmeier.com:msn/gitgud.git +refs/heads/*:refs/remotes/origin/*

Seen branch in repository origin/dmz

Seen branch in repository origin/master

Seen 2 remote branches

Checking out Revision ccf563e57ccff42045d442e4a4f4354c62401cd7 (origin/master)

 > C:\Program Files\Git\cmd\git.exe config core.sparsecheckout # timeout=10

 > C:\Program Files\Git\cmd\git.exe checkout -f 
 > ccf563e57ccff42045d442e4a4f4354c62401cd7

First time build. Skipping changelog.

Finished: SUCCESS


9. Delete either of the Branch Specifiers and rerun the build, fails again with 
the original error message.



-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/98d25b88-3206-45f7-b711-5feafae87b6e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to