[Ci-users] Splitting a job and making dependencies

Wed May 31 14:44:19 UTC 2017
Václav Pavlín <vasek at redhat.com>

Hi all,

I am very new to Jenkins, so please bear with me:)

We have this JJB config:

Where there is this job-template:

The script basically copies content of git cloned directory and runs build
script. If that run is successful it deploys the resulting docker image to

We want to deploy images by tag - which corresponds to git commit hash, so
it gets templated in by oc process.

The problem is that there are templates which have more parameters and we
have taken care of this with a small script in this repostory:

So my goal is to use that saas tool to do the deploy instead of plain oc
process > oc apply.

As we have multiple templates which have different scripts, I'd like to
avoid code duplication - I don't want to copy&paste the oc process/oc apply
or the script calls around in the file.

So my thinking to solve this was to create some kind of hierarchy - I found
something about dependencies and something called multijob where a job
would trigger a build phase (build a docker image) and a deploy phase (oc
apply). The key part is that if any of the phases fail, whole job fails.
Also, deploy phase must not be triggered when build phase fails.

What would be the correct approach with JJB to solve this? Is this wrong
thinking? Am I missing something from the Jenkins point of view?

I know this would be ideally solved by pipelines, but I don't think that is
an option at the moment.

Looking forward to comments and suggestions,

Red Hat Developer Tools team
Brno, Czech Republic
Phone: +420 739 666 824
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.centos.org/pipermail/ci-users/attachments/20170531/ec83f643/attachment-0001.html>