CI: Move image building to a role
This role can be then used in kolla-ansible instead of setup_gate.sh Change-Id: Ibf04bd90a15e7d3949214d15a8b8e25f2050bb65
This commit is contained in:
parent
9b10b7d235
commit
20cdc32537
@ -146,6 +146,7 @@
|
|||||||
kolla_logs_dir: "{{ zuul_output_dir }}/logs/kolla"
|
kolla_logs_dir: "{{ zuul_output_dir }}/logs/kolla"
|
||||||
kolla_build_logs_dir: "{{ kolla_logs_dir }}/build"
|
kolla_build_logs_dir: "{{ kolla_logs_dir }}/build"
|
||||||
virtualenv_path: "/tmp/kolla-virtualenv"
|
virtualenv_path: "/tmp/kolla-virtualenv"
|
||||||
|
kolla_build_template_overrides_path: "{{ zuul.executor.work_root }}/{{ zuul.projects['opendev.org/openstack/kolla'].src_dir }}/tests/templates/template_overrides.j2"
|
||||||
|
|
||||||
- job:
|
- job:
|
||||||
name: kolla-base-podman
|
name: kolla-base-podman
|
||||||
|
4
roles/kolla-build/defaults/main.yml
Normal file
4
roles/kolla-build/defaults/main.yml
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
---
|
||||||
|
kolla_build_logs_dir: "{{ zuul_output_dir }}/logs/kolla/build"
|
||||||
|
kolla_build_template_overrides_path: ""
|
||||||
|
kolla_build_venv_path: "/tmp/kolla-virtualenv"
|
16
roles/kolla-build/tasks/main.yml
Normal file
16
roles/kolla-build/tasks/main.yml
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
---
|
||||||
|
- name: Template template_overrides.j2
|
||||||
|
ansible.builtin.template:
|
||||||
|
src: "{{ kolla_build_template_overrides_path }}"
|
||||||
|
dest: /etc/kolla/template_overrides.j2
|
||||||
|
when: kolla_build_template_overrides_path | length > 0
|
||||||
|
|
||||||
|
- name: Run kolla-build to template out dockerfiles
|
||||||
|
ansible.builtin.command:
|
||||||
|
cmd: >-
|
||||||
|
{{ kolla_build_venv_path }}/bin/kolla-build --template-only
|
||||||
|
--work-dir {{ kolla_build_logs_dir }}/work_dir
|
||||||
|
|
||||||
|
- name: Run kolla-build
|
||||||
|
ansible.builtin.command:
|
||||||
|
cmd: "{{ kolla_build_venv_path }}/bin/kolla-build"
|
@ -38,13 +38,5 @@
|
|||||||
- import_role:
|
- import_role:
|
||||||
name: kolla-build-config
|
name: kolla-build-config
|
||||||
|
|
||||||
- name: Template template_overrides.j2
|
- import_role:
|
||||||
template:
|
name: kolla-build
|
||||||
src: "{{ zuul.executor.work_root }}/{{ zuul.project.src_dir }}/tests/templates/template_overrides.j2"
|
|
||||||
dest: /etc/kolla/template_overrides.j2
|
|
||||||
|
|
||||||
- name: Run kolla-build to template out dockerfiles
|
|
||||||
command: "{{ virtualenv_path }}/bin/kolla-build --template-only --work-dir {{ kolla_build_logs_dir }}/work_dir"
|
|
||||||
|
|
||||||
- name: Run kolla-build
|
|
||||||
command: "{{ virtualenv_path }}/bin/kolla-build"
|
|
||||||
|
Loading…
Reference in New Issue
Block a user