Parameterize build-containers job to allow push to registry

As tracked by ci team in [1] the current periodic container
build job is very different to the upstream job
tripleo-build-containers-centos-7. In order to re-use this
upstream job as part of the periodic, we need to parameterize
it so we can push to the rdo registry and containers have the
right tags (when periodic container build & push).

This review leaves the upstream job unchanged with parameters
defaulting to their current value. The periodic job defined
in [2] inherits from this job and will handle secrets/login
and passing the right values for registry/tag.

[1] https://tree.taiga.io/project/tripleo-ci-board/us/652
[2] https://review.rdoproject.org/r/#/c/18729
Change-Id: Idf1f5a696a5163bd54cb000aed09daf00d51400b
This commit is contained in:
Marios Andreou 2019-02-06 18:57:44 +02:00
parent 1d890565fe
commit 1d76bb1ecb
3 changed files with 15 additions and 5 deletions

View File

@ -0,0 +1,3 @@
push_registry: "127.0.0.1:8787"
push_tag: "latest"
push_containers: "false"

View File

@ -8,9 +8,12 @@
include_vars:
file: "common.yaml"
- name: Get branch
- name: Set facts for kolla-build.conf
set_fact:
ci_branch: "{{ zuul.branch | default('master') | replace('stable/','') }}"
push_registry: "{{ push_registry | default('127.0.0.1:8787') }}"
push_tag: "{{ push_tag | default('latest') }}"
push_containers: "{{ push_containers | default(false) | bool }}"
- name: Install pip
become: true

View File

@ -1,10 +1,14 @@
[DEFAULT]
base=centos
type=binary
namespace='{{ ci_branch | replace("/", "") }}'
registry=127.0.0.1:8787
tag=latest
registry={{ push_registry }}
tag={{ push_tag }}
template_override={{ openstack_git_root }}/tripleo-common/container-images/tripleo_kolla_template_overrides.j2
# we use the repos off the main host as they will already have the correct mirror info in them
rpm_setup_config=http://172.17.0.1/delorean.repo,http://172.17.0.1/delorean-{{ ci_branch }}-testing.repo
push={{ push_containers }}
{% if 'periodic' in zuul.pipeline %}
namespace='tripleomaster'
{% else %}
namespace='{{ ci_branch | replace("/", "") }}'
{% endif %}