User Tools
toolsandtechnologies:jenkins_2_feature_builds
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| toolsandtechnologies:jenkins_2_feature_builds [2018/05/22 12:18] – ccarew | toolsandtechnologies:jenkins_2_feature_builds [2021/06/25 10:09] (current) – external edit 127.0.0.1 | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| + | ====== Jenkins 2 - Creating Builds per Features Branch/ | ||
| + | --- // | ||
| + | ===== Make Jenkins Publicly Accessible | ||
| + | **This can be skipped if Jenkins is already publicly accessible.** | ||
| + | |||
| + | This is very networking focused so if it is not already setup, get someone to help/the networking person to do it. | ||
| + | |||
| + | In most cases you should just be able to port forward port 8080 directly to Jenkins 8080, however if the Public IP you are using already has an 8080 exposed to a different machine you will need a customer service, a policy to allow the service and finally assign the service (via VIP) from the Public IP to the Jenkins server | ||
| + | |||
| + | - Find where you can make a custom service (depends on Router Firmware but may be in Policy-> | ||
| + | - If one is not there for your desired function, say to forward port 9090 from external source to port 8080 of internal server then create a new one | ||
| + | - In most cases you will want TCP, source Port Low and High should be the same, in this case 9090 and destination port should be the same for low and high so 8080 | ||
| + | - Give the service a good name and save it | ||
| + | - Find policies (Policy-> | ||
| + | - Find the VIP interface (Network-> | ||
| + | |||
| + | ===== Generating Builds Per Branch in Jenkins ===== | ||
| + | Some plugins will need to be installed for this, mainly the Bitbucket Plugin and Pipeline: Multibranch Plugin - these may already be installed. | ||
| + | |||
| + | - Navigate to where you want the folder which will contain all the Jenkins builds for the projects | ||
| + | - Click New Item | ||
| + | - Give it a name | ||
| + | - Ensure Multibranch Pipeline is selected | ||
| + | - Click OK | ||
| + | - Give it a display name like APPLICATION-feature-branches | ||
| + | - In Branch Source choose Bitbucket and select the correct credentials | ||
| + | - Set the owner to be ' | ||
| + | - Select the Repo you want to have multibranch builds of | ||
| + | - Auto Discovery should populate, but remove the Pull Request discovery at it should be enough to test on a per commit level | ||
| + | - Discover Branches should be set to All branches | ||
| + | - For Property Strategy click 'Named Branches get different properties' | ||
| + | - Add exceptions that you do not want to be built by this process (master, dev, REL-* for example) and ensure they have the property ' | ||
| + | - Build Configuration should be Jenkins Files | ||
| + | - Orphaned Item Strategy should have Max # of old items to keep, set to 1 | ||
| + | - That's it, hit save and the process should go off and discover all branches for the project and build them | ||
| + | |||
| + | ===== New Builds for New Branches and Build on new Commits - Bitbucket Webhook ===== | ||
| + | This is the reason why we need Jenkins to be publicly accessible, so Bitbucket can send Webhooks to Jenkins and cause the builds to happen as well as show in Bitbucket if a commit build passed/ | ||
| + | |||
| + | - Go to the Bitbucket Project | ||
| + | - Go to settings | ||
| + | - Click Webhooks | ||
| + | - Add a new Webhook with the name Jenkins, URL should be http:// | ||
| + | - Click save | ||
| + | - Create a new branch (even if it is a dummy), make a small change and push, see if a new build is created and starts running | ||
| + | |||
| + | |||
| + | |||
| + | |||
| + | |||
| + | |||