Jobs Cycling & Automation
Continuous integration & delivery assumes the complete processes’ automation without any manual steps involved. In our case, this will result in a new environment creation after every significant change, made to your project, with its automatic checking for the proper operability and instant delivery to the target audience.
And to make it even more convenient, we’ll use a special jobs’ initiation trigger, that is executed upon each commit action - this will help to completely exclude the human-dependent delays and speed up passing the new release cycles.
So, in order to achieve such a tight integration of the operations, that altogether constitute the DevOps pipeline, let’s:
- cycle Jenkins jobs
- [#webhook](add webhook (initiation trigger))
First, you need to launch the Jenkins jobs we’ve set previously into a single continuous cycle:
Create Environment > Build and Deploy > Dev Tests > Migrate to QA > QA Tests > Migrate to Production
The first element in our chain is Create Environment, thus expand the context menu for it and chose the Configure option.
In the opened frame, scroll down to the end of the page and choose the Build other project option within the Post-build Actions section:
In the appeared field, state the next element of our chain (i.e. Build and Deploy in this case).
- Repeat these two steps for all the rest of the jobs (obviously, except the last Migrate to Production one) until you create a cycle.
Once everything is prepared and pipeline is built, the last thing that is left to perform is to define the initiation point of launching our cycle.
For that, firstly you’ll need to get the URL of the Create Environment job scheduler - right-click on the corresponding icon and choose the Copy link address option:
We’ll use the received value for setting the appropriate githook, bound to the commit action. Thus, open settings of your VCS project (placed at GitHub in our case) and navigate to the Webhook section (or the similar one, according to the used repository storage).
Here, you need to:
- paste the copied link to the Payload URL field
- choose the application/x-www-form-urlencoded option within the Content type drop-down list
- remove the Secret (if stated)
- select the Let me select individual events item at the events’ section and tick the Commit comment line
Finish with the Add webhook button below.
Great, everything is set up and maximally optimized! Now, just commit any change to your project and enjoy the fully automated procedure of the new build processing, that starts from the environment creation and finishes with the already working new application at the production stage.