Example
Here we will be checking out the latest copy of our project's code, run the tests and will make the application live.To achieve that, follow below steps:
- Open Jenkins in browser.
- Click the New Job link.
- Enter project name and select the Build a free-style software project link.
- Click on Ok button.
- Under the Source code management section, select the radio box next to your source code management tool. In my case I have selected Git.
Provide url of git repo like git://github.com/example/example.git
- Under the Build triggers, select the radio box next to Poll SCM.
- Provide
***** in Schedule box. This box is responsible to trigger the build at regular intervals. ***** specifies that, the job will get trigger every minute for changes in git repo.
- Under the Build section, click the Add Build Step button and then select the option by which you want to build the project. I have selected Execute Shell. In the command box write the command to build,run the tests, and deploy it to prod.
- Scroll down and Save.
So above we have configured a basic project in Jenkins which will trigger the build at every minute for change in your git repository.
Note: To setup the complex project, you may have to install some plugins in Jenkins.