snippetMinor
how to run multiple environments in single job in Jenkins
Viewed 0 times
jenkinssinglemultiplehowjobenvironmentsrun
Problem
I have two environments - front-end and back-end. My front-end deployment has one job and my back-end deployment has another job. My team wants to deploy both front-end and back-end together. Can combine them into single job?
Ideally, they can choose whatever environment and respective branches they required to deploy for their testings in this one job.
Ideally, they can choose whatever environment and respective branches they required to deploy for their testings in this one job.
Solution
A pretty standard way of doing this would be to chain your jobs or your pipelines. This lets you keep separate jobs (which can be useful), but lets you trigger one job from the other and visualize the end-to-end flow.
So, you still just tell one job to run, but it runs both properly. Their config and logs are still well separated and you get all the other isolation related benefits.
Example: https://www.jrebel.com/blog/using-jenkins-build-pipelines
You can also do this in normal Jenkins jobs not using a pipeline; there is an option to trigger other jobs near the bottom usually.
So, you still just tell one job to run, but it runs both properly. Their config and logs are still well separated and you get all the other isolation related benefits.
Example: https://www.jrebel.com/blog/using-jenkins-build-pipelines
You can also do this in normal Jenkins jobs not using a pipeline; there is an option to trigger other jobs near the bottom usually.
Context
StackExchange DevOps Q#11269, answer score: 1
Revisions (0)
No revisions yet.