Skip to content

Commit 20cdc32

Browse files
committed
CI: Move image building to a role
This role can be then used in kolla-ansible instead of setup_gate.sh Change-Id: Ibf04bd90a15e7d3949214d15a8b8e25f2050bb65
1 parent 9b10b7d commit 20cdc32

File tree

4 files changed

+23
-10
lines changed

4 files changed

+23
-10
lines changed

.zuul.d/base.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,7 @@
146146
kolla_logs_dir: "{{ zuul_output_dir }}/logs/kolla"
147147
kolla_build_logs_dir: "{{ kolla_logs_dir }}/build"
148148
virtualenv_path: "/tmp/kolla-virtualenv"
149+
kolla_build_template_overrides_path: "{{ zuul.executor.work_root }}/{{ zuul.projects['opendev.org/openstack/kolla'].src_dir }}/tests/templates/template_overrides.j2"
149150

150151
- job:
151152
name: kolla-base-podman
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
---
2+
kolla_build_logs_dir: "{{ zuul_output_dir }}/logs/kolla/build"
3+
kolla_build_template_overrides_path: ""
4+
kolla_build_venv_path: "/tmp/kolla-virtualenv"

roles/kolla-build/tasks/main.yml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
---
2+
- name: Template template_overrides.j2
3+
ansible.builtin.template:
4+
src: "{{ kolla_build_template_overrides_path }}"
5+
dest: /etc/kolla/template_overrides.j2
6+
when: kolla_build_template_overrides_path | length > 0
7+
8+
- name: Run kolla-build to template out dockerfiles
9+
ansible.builtin.command:
10+
cmd: >-
11+
{{ kolla_build_venv_path }}/bin/kolla-build --template-only
12+
--work-dir {{ kolla_build_logs_dir }}/work_dir
13+
14+
- name: Run kolla-build
15+
ansible.builtin.command:
16+
cmd: "{{ kolla_build_venv_path }}/bin/kolla-build"

tests/playbooks/run.yml

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -38,13 +38,5 @@
3838
- import_role:
3939
name: kolla-build-config
4040

41-
- name: Template template_overrides.j2
42-
template:
43-
src: "{{ zuul.executor.work_root }}/{{ zuul.project.src_dir }}/tests/templates/template_overrides.j2"
44-
dest: /etc/kolla/template_overrides.j2
45-
46-
- name: Run kolla-build to template out dockerfiles
47-
command: "{{ virtualenv_path }}/bin/kolla-build --template-only --work-dir {{ kolla_build_logs_dir }}/work_dir"
48-
49-
- name: Run kolla-build
50-
command: "{{ virtualenv_path }}/bin/kolla-build"
41+
- import_role:
42+
name: kolla-build

0 commit comments

Comments
 (0)