Charles PHAM
Charles PHAM

Reputation: 920

Got error trigger Jenkins builds by pushing to Github

I config Jenkins deploy PHP app by trigger the script deployment whenever developers pushed their code to Github with domain .mydomain.com. If developer create new branch and push some changes to that branch, it works perfectly fine, the strange thing is when developer create new branch and push to server (don't change anything just create new branch and push) it doesn't trigger the script deployment. Could you please help? enter image description here

Upvotes: 1

Views: 308

Answers (1)

RejeeshChandran
RejeeshChandran

Reputation: 4358

In Git configuration there is a field Branch Specifier (blank for default): if you put there ** it will build all branches from all remotes.

But if you are creating a new branch and push to server it won't trigger the job. As Github plugin in Jenkins configuration is monitoring the changes in the repo and creating a branch is not a change. So the job won't trigger for that branch until you do a commit in that branch. And I feel this is the correct behavior.

For example when you do a commit xxxx on branch master, your job gets triggered with commit id xxxx. Now you create a branch say branch1 from master and you push to server. As you can see there is not difference between commit xxxx and branch1 so there is no need to build branch1 in Jenkins.

Upvotes: 1

Related Questions