Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Does Jenkins Webhook work with forked repositories?

Rob Oxspring February 19, 2015

We have a stash repo "myrepo" and a fork "myrepofork" with a pull request of changes to be brought back to "myrepo".  The change in "myrepofork" has changeset 328a334d194 and as far as I can tell Jenkins is told to build that changeset, but not that the changeset is to be found in "myrepofork".

Is this supposed to work? Do I need to configure things differently? Or do I need to give my teams access to write branches into the official repository and create pull requests from there?

Jenkins job console snippet:

00:00:01.089  > git rev-parse 328a334d19468ee9bf569de72fdf8a14abc5dcd4^{commit} # timeout=10
00:00:01.099 FATAL: Command "git rev-parse 328a334d19468ee9bf569de72fdf8a14abc5dcd4^{commit}" returned status code 128:
00:00:01.099 stdout: 328a334d19468ee9bf569de72fdf8a14abc5dcd4^{commit}
00:00:01.099 
00:00:01.099 stderr: fatal: ambiguous argument '328a334d19468ee9bf569de72fdf8a14abc5dcd4^{commit}': unknown revision or path not in the working tree.
00:00:01.099 Use '--' to separate paths from revisions
00:00:01.099 
00:00:01.099 hudson.plugins.git.GitException: Command "git rev-parse 328a334d19468ee9bf569de72fdf8a14abc5dcd4^{commit}" returned status code 128:
00:00:01.099 stdout: 328a334d19468ee9bf569de72fdf8a14abc5dcd4^{commit}
00:00:01.099 
00:00:01.099 stderr: fatal: ambiguous argument '328a334d19468ee9bf569de72fdf8a14abc5dcd4^{commit}': unknown revision or path not in the working tree.
00:00:01.099 Use '--' to separate paths from revisions

 

 

1 answer

0 votes
Tomas Bjerre February 19, 2015

No it is not suppose to work. You will need a Jenkins job for repo "myrepofork".

You could poll the REST API:s of Stash to find new pull requests. Then you can have a parameterized build job in Jenkins that builds pull requests. So that you dont need to create new build jobs for every new fork, just one job that builds pull requests from any repo.

Find all repos: http://stash/rest/api/1.0/projects/EXP/repos/

Find all pull requests: http://stash/rest/api/1.0/projects/EXP/repos/REPOSLUG/pull-requests?base&details&filterText&orderBy


 

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events