git - Trigger jenkins build on stash pull request -
i've been trying build on pr working time following usual guides. ran issues.
here added existing configuration @ jenkins project:
source code management: multiple scms - repository url: ssh://git@git.company.pt/projectcode/repname.git - credentials ssh key working - batches build: */${sourcebranch} - repository browser: auto - additional behaviours: none build triggers: - poll scm
and the previous working build & post-build actions
on stash side there not configure. here ss of existing configurations , test result @ settings -> hooks -> stash webhook jenkins:
as can see in screenshot, test configuration works , able send message jenkins. received jenkins following log message:
started on apr 29, 2015 8:01:23 polling scm changes on master using strategy: default using git_ssh set credentials > git --version # timeout=10 > git -c core.askpass=true ls-remote -h ssh://git@git.fraunhofer.pt/glp/golivephone.git # timeout=10 done. took 0.18 sec no changes
right, didn't change anything! problem when go actual branch , click "trigger build". git polling log stays same , no messages sent jenkins. missing configuration step @ stash or in branch creation? dont think related jenkins build, since dont pooling log message when trigger build. debug idea nice find out what's wrong.
edit:
network activity when trigger build triggered: request
remote address:10.211.8.19:443 url:https://stash.fraunhofer.pt/rest/jenkins/latest/projects/projectcode/repos/repname/triggerjenkins?branch=bugfix/glp-702-about-screen-doesn-t-update-on-subscription&sha1=cd49ac1be47e89ecc4f02c1d3867d54e2b2ff78a request method:post status code:204 no content ---payload--- none ---query string parameter--- branch:bugfix/glp-702-about-screen-doesn-t-update-on-subscription sha1:cd49ac1be47e89ecc4f02c1d3867d54e2b2ff78a
compared test one:
remote address:10.211.8.19:443 request url:https://stash.fraunhofer.pt/rest/jenkins/latest/projects/projectcode/repos/repname/test request method:post status code:200 ok ---payload--- {jenkinsbase: ["http://i-255.cloud.fraunhofer.pt:8080/"],…} gitrepourl: ["ssh://git@git.fraunhofer.pt/glp/golivephone.git"] 0: "ssh://git@git.fraunhofer.pt/glp/golivephone.git" ignorecerts: ["true"] 0: "true" jenkinsbase: ["http://i-255.cloud.fraunhofer.pt:8080/"] 0: "http://i-255.cloud.fraunhofer.pt:8080/" omithashcode: ["true"] 0: "true" ---query string parameter--- none
you may have @ https://christiangalsterer.wordpress.com/2015/04/23/continuous-integration-for-pull-requests-with-jenkins-and-stash/ describe detailed steps how setup jenkins , stash trigger automatically correct jenkins build(s) when pull request created or updated.
it uses jenkins git plugin , pull request notifier stash add-on , selects correct build using notification feature of jenkins git plugin.
Comments
Post a Comment