As you pointed out Jenkins pipeline is a great fit for this scenario for a number of reasons.- It keeps all the stages in one pipeline with little duplication- Great integration with OpenshiftThat said I understand having to switch from JJB to Pipeline.There is also a way you can start to combine both while still using JJB:
Multijob is a good way to keep jobs in a pipeline that allows certain jobs to run in parallel and then gate on a final step.I do believe this can fit what you are looking for. If you need to run multiple similar scenarios of the same steps with subtle config differences than matrix-jobs are great as well.I did a blog post on this of how we used this. We use it for Openshift-ansible committed and PRs currently.I hope this helps.On Wed, May 31, 2017 at 10:44 AM, Václav Pavlín <vasek@redhat.com> wrote:______________________________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/maste r/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--_________________
Ci-users mailing list
Ci-users@centos.org
https://lists.centos.org/mailman/listinfo/ci-users
---== @ri ==-