From 6bcde4f00759d292335ee59f365753ad00521e8b Mon Sep 17 00:00:00 2001 From: Jean-Philippe Evrard Date: Thu, 11 Oct 2018 10:13:08 +0200 Subject: [PATCH] Add branching in LOCI This will allow us to create jobs with branches to publish images for different upstream branches direcly in LOCI. Change-Id: I57e6cadd647e2bb624da4fea9749534de4617926 --- playbooks/vars.yaml | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/playbooks/vars.yaml b/playbooks/vars.yaml index 735d60b..d3916b8 100644 --- a/playbooks/vars.yaml +++ b/playbooks/vars.yaml @@ -13,7 +13,17 @@ reuse_requirements: False # when running as a post job for cinder, the project is "cinder". We statically # declare the path rather than using zuul variables so thats not an issue loci_src_dir: "src/git.openstack.org/openstack/loci" -branch: "{{ zuul_execution_branch.split('/')[-1] }}" +# Branch name used for image building and publishing +# If running in an environment with zuul and under a branched project +# (like openstack/cinder, openstack/nova, ... but not openstack/loci) +# this will be automatically be set to the appropriate branch name (rocky, queens, ...) +branch: "{{ branchname | default(zuul_execution_branch.split('/')[-1]) }}" +# Upstream code reference. +# As LOCI is not building images on a per-commit basis on upstream openstack projects, +# pointing to upstream zuul_branch for gating is enough. +# If a project_ref is passed in a gating variable (like how you would do directly +# in the command line), it will get consumed during image building. +project_reference: "{% if project_ref is defined %}{{ project_ref }}{% elif zuul_branch is defined %}{{ zuul_branch }}{% else %}master{% endif %}" distros: - name: centos @@ -26,6 +36,7 @@ distros: project: PROJECT: "{{ project }}" PROJECT_REPO: http://172.17.0.1/git/openstack/{{ project }} + PROJECT_REF: "{{ project_reference }}" WHEELS: 172.17.0.1:5000/loci/requirements:{{ branch }}-centos FROM: base:centos requirements: @@ -45,6 +56,7 @@ distros: project: PROJECT: "{{ project }}" PROJECT_REPO: http://172.17.0.1/git/openstack/{{ project }} + PROJECT_REF: "{{ project_reference }}" WHEELS: 172.17.0.1:5000/loci/requirements:{{ branch }}-ubuntu FROM: base:ubuntu requirements: @@ -65,6 +77,7 @@ distros: # project: # PROJECT: "{{ project }}" # PROJECT_REPO: http://172.17.0.1/git/openstack/{{ project }} +# PROJECT_REF: "{{ project_reference }}" # WHEELS: 172.17.0.1:5000/loci/requirements:master-debian # FROM: base:debian # requirements: