Integrate Jenkins with github and
Automatically kick off Jenkins when new build is pushed to git hub:
Automatically kick off Jenkins when new build is pushed to git hub:
Get web hook url from Jenkins.
Go to Jenkins
Click manage Jenkins
Click Configure system
Go to GitHub Plugin Configuration
Click Advanced
Check specify another hook url for github configuration
Copy the hook url and uncheck the check box
Go to github repository
Go to settings
Click Webhooks and services
In webhook section, click Add webhook
Paste the url to the Payload URL
Now, select Which events would you like to trigger this
webhook?
Everything or every push or select other events from the
options such as Dev team push then kick off the execution.
You can also select content type
You can leave the active checked
Click Add webhook
Now, go to Jenkins
Click a jenkin job
Click configure
In build triggers section, check Build when a change is
pushed to Github
Click Save
Push to Github
Cmd prompt
Git status --- to know the status
Git commit –am “comment”
Git push
Execution starts in Jenkins
Integrate Jenkins with github:
Go to Jenkins
Click manage Jenkins
Manage plugins
Click tab available
Search github
Check github integration plugin
Click download now and install after restart
This download the plugin, download other dependencies as
well
Check restart Jenkins when installation is complete
Now go to git hub
Go to your repository and copy the URL
Create job in Jenkins:
Click new item
Give job name
Select freestyle project. You can select pipeline also
Click ok
In general tab , check github project
Paste the URL of the
project copied above
Scroll down, In source code management section check the
radio button GIT
You have to paste another URL to Repository URL, this you
got from github-clone or download button
Mention the branch in which you want to build. Default is
master
Scroll down to build triggers
Check which trigger is suitable for your purpose. I am
selecting GitHub hook trigger for GitScm polling
There are other options as well if you need.
Click save
No comments:
Post a Comment