In my project, I have 3 web-applications, all depend on one all-commons
project.
In my Jenkins server, I built 4 jobs, all-commons_RELEASE
, web-A_RELEASE
, web-B_RELEASE
and web-C_RELEASE
.
The role of these jobs is to build the artifacts, which are deployed on our Nexus. Then, someone retrieve these artifacts in Nexus and deploy them on our dev / homologation servers.
What I want, is to have one (additional?) job that will launch all the 4 builds, in a sequential way. This way, once this job is finished, all the RELEASE jobs have been executed. Of course, if one build fails, the process is stopped.
My first thought was to indicate the web-A_RELEASE
in the Build other projects list of the Post-build Actions of all-commons_RELEASE
.
Then, web-B_RELEASE
is dependent on web-A_RELEASE
, and so on.
However, I want to be able to start any of them separately, which is not possible if I indicate a dependency on the projects. For example, if I manually start web-B_RELEASE
, then web-C_RELEASE
will be built after that, which is not what I want...
Do you have any idea how I can achieve that, or a plugin to help me to do that?
Regards.
ps: Jenkins 1.430, and all RELEASE jobs are free-style projects (they mix Maven and bash commands).
Perhaps you could use the Parametrized Trigger Plugin?
Using the plugin you can set the trigger as a build step in your "Pipeline" Job. There is a checkbox "Block until triggered job is finished", which you need to activate. You could simply configure your three jobs to be triggered this way, and the triggering would only occur if you run this new Pipeline Job, so running the other jobs without triggering anything would work fine.
This should be exactly what you need.
Don't know if you've found your answer yet, but for others who are curious:
You can create another job build_all, and then have each of the other builds triggered as build steps.
The setup you'd want would look like this for build_all, with each build step being "Trigger/Call builds on other projects"
- Build Step 1 : all-commons_RELEASE
- Build Step 2 : web-A_RELEASE
- Build Step 3 : web-B_RELEASE
- Build Step 4 : web-C_RELEASE
Make sure you check the "Block until the triggered projects finish their builds" option to ensure the builds happen sequentially.
Try this
you can sequentially run or build your job like this :
build("job1")
build("job2")
.
.
build("job-n")
来源:https://stackoverflow.com/questions/7528894/how-to-build-a-pipeline-of-jobs-in-jenkins