Configuring automatic build by push for git repositoryTweet
Posted on Sunday Mar 01, 2015 at 07:15PM in Jenkins
We can start the build by send request to following URL.
In my case, Jenkins is deployed in
/, and the server is running on port
18080. so the command to start a build of the job named
trader will be:
So put following shell script into
$ORIGIN_BARE_REPOSITORY/hooks/post-receive and execute
chmod +x post-receive.
#!/bin/sh curl http://localhost:18080/job/trader/build
Push some modification as follows:
$ echo hook test >> hi.txt $ git add hi.txt $ git commit -m 'hook test' $ git push origin master
Check the build was run automatically as expected, and the output.