Jenkins Integration with Git Server
Here is my configuration of Jenkins integration with Git Server - in my case Atlassian Bitbucket Server 4.1.3 x64.
- Install Jenkins ButBucket Plugin in Jenkins
- Install Bitbucket Server Webhook to Jenkins in Bitbucket via Web GUI, then set parameters of this Repo
- Go to specific Repo, then go to Settings, then Hooks
- Enable "Bitbucket Server Webhook to Jenkins"
- Set Jenkins URL, Repo Clone URL
- Go to Jenkins
- Create a Task
- Set Git Source Code Management
- Git Repository URL,
- Credentials,
- Branches (I added two branches - develop, master in my case)
- Additional Behaviors
- Additional Behaviors: Check out to a sub-directory: C:\Build\AcRepo
- Build Triggers:
- Check option: "Build when a change is pushed to BitBucket"
- Check option: "Poll SCM": Schedule: H/2 * * * *
- The schedule follow the syntax of cron. The minimal time I can set is 2 minutes.
- No once you push code the Repo, Jenkins will pull down the branch you push to, and build the project immediately.