Use in your own CI job

In Prow

The CI Framework provides a container exposing the whole framework as well as all of the helpers. You may leverage it like this:

 1---
 2build_root:
 3  cifmw:
 4    name: "ci-framework-image"
 5    tag: "latest"
 6    namespace: "openstack-k8s-operators"
 7tests:
 8- as: pre-commit
 9  from: cifmw
10  clone: true
11  commands: |
12    export HOME=/tmp
13    export ANSIBLE_LOCAL_TMP=/tmp
14    export ANSIBLE_REMOTE_TMP=/tmp
15    make -C ../ci-framework pre_commit_nodeps BASEDIR ./

Please refer to the make manpage for more fun! Please refer to the openshift CI doc as well as the ci-operator for more details.

In Zuul

The Framework exposes various jobs you may re-use as parent. Please have a look at the zuul.d content for more details.

Special parameters

If you consume the existing playbooks, you may have to pass down some extra parameters, for instance in order to point to your own scenarios, or any of the environment specificities you need to address.

Worry not, there’s a way! Passing cifmw_extras parameter from your Zuul job definition, you can pass any kind of parameters as a list:

zuul.d/job.yaml
 1- job:
 2    name: cifmw-end-to-end
 3    parent: cifmw-end-to-end-base
 4    files:
 5      - ^roles/.*_build/(?!meta|README).*
 6      - ^roles/build.*/(?!meta|README).*
 7      - ^roles/openshift_*/(?!meta|README).*
 8      - ^playbooks/.*build.*.yml
 9    irrelevant-files:
10      - ^.*/*.md
11      - ^ci/templates
12    vars:
13      cifmw_extras:
14        - '@scenarios/centos-9/ci-build.yml'
15    run: ci/playbooks/e2e-run.yml

Here, the custom environment file “edpm-ansible.yml” will be passed down to the playbook.

By the way, you may inherit from this very job since it’s exposed from within the ci-framework!