How to make Jenkins poll git upstream? -
i have 2 git repos: (public) , b (private), b fork of a, , b needs synchronized regularly. have added repo a remote upstream of repo b this:
cd <local_folder_of_repo_b> git remote add upstream <url_of_repo_a> i know can merge changes b manually this:
cd <local_folder_of_repo_b> git fetch upstream git merge upstream/master git push origin master i have created jenkins job triggers when there commits in repo b. however, need job trigger when there commits in repo a, too. merge changes repo b , build.
edit: have tried using jenkins multiple scms plugin. added 2 git repositories , provided different local folders them, explained in plugin page. jenkins job correctly polls both repos , triggers itself, trying avoid need keep 2 separate repos on hard disk, because large , i'm planning scale approach.
you consider 1 job triggered:
- by new commits in
b(usual jenkins polling) - by new commits in
a(withapushing jenkins notification), hook ona, similar one:
update hook on a:
repository_basename=$(basename "$pwd") curl http://jenkins.local:8080/git/notifycommit?url=ssh://git@git.local/$repository_basename in case, job starts fetching a (upstream) , merging upstream/master master, in case.
Comments
Post a Comment