In the big picture, I want to give my users a job where they specify both 
the source (fork) and destination (upstream) git repository, as well as the 
source and destination branch names, and I want jenkins to merge the source 
(repo, branch) into the destination (repo, branch), then build. The source 
repo is a fork of the upstream repo, necessarily.

The git-plugin clones and fetches everything without any problem, but it 
errors out in the end. I am puzzled.

Here is the configuration:
Repo URL: ${UPSTREAM_REPO}
Name: upstream
Refspec: 
+refs/heads/${UPSTREAM_BRANCH}:refs/remotes/upstream/${UPSTREAM_BRANCH}

Repo URL: ${FORK_REPO}
Name: fork
Refspec: +refs/heads/${FORK_BRANCH}:refs/remotes/fork/${FORK_BRANCH}

Additional behaviours:
Wipe out repository and force clone
Check out to specific local branch: ${UPSTREAM_BRANCH}
Merge before build
Name of repository: upstream
Branch to merge to: ${UPSTREAM_BRANCH}

The the user supplies the four parameters:
UPSTREAM_REPO=ssh://g...@stash.domain.com/path/project.git
UPSTREAM_BRANCH=master
FORK_REPO=ssh://g...@stash.domain.com/~user/project.git
FORK_BRANCH=master

The the user hits build, and the git-plugin ends with an error:
Seen branch in repository fork/master
Seen branch in repository upstream/master
Seen 2 remote branches
ERROR: Couldn't find any revision to build. Verify the repository and 
branch configuration for this job.
Finished: Failure

There are no errors before that in the log. The workspace contains the .git 
folder, with those branches not checked out - despite the fact that I asked 
for a specific local branch to be checked out:
git branch -a
  remotes/fork/master
  remotes/upstream/master

What causes the Git plugin to error out like that? What makes it decide 
that it should abort instead of proceeding with the build?

I use Git 2.4.3, git-plugin 2.4.0, jenkins 1.609.1.

Thanks,
Martin

-- 
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/351b9b72-0eea-4cd6-80ee-ae8da2d0a1aa%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to