Hi all,

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

We have this JJB config: https://github.com/almighty/almighty-jobs/blob/master/devtools-ci-index.yaml

Where there is this job-template: https://github.com/almighty/almighty-jobs/blob/master/devtools-ci-index.yaml#L195

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 OpenShift.

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: https://github.com/openshiftio/saas/

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,
Vašek

--
Red Hat Developer Tools team
Brno, Czech Republic
Phone: +420 739 666 824