diff --git a/playbooks/image-build/post.yaml b/playbooks/image-build/post.yaml new file mode 100644 index 0000000000..12ba51b1dd --- /dev/null +++ b/playbooks/image-build/post.yaml @@ -0,0 +1,10 @@ +- hosts: all + name: Copy image + tasks: + - synchronize: + dest: "{{ zuul.executor.log_root }}" + mode: pull + src: "{{ ansible_user_dir }}/test-images" + verify_host: true + rsync_opts: + - "--exclude=/*/*/" \ No newline at end of file diff --git a/playbooks/image-build/run.yaml b/playbooks/image-build/run.yaml new file mode 100644 index 0000000000..e0121da251 --- /dev/null +++ b/playbooks/image-build/run.yaml @@ -0,0 +1,45 @@ +- hosts: all + tasks: + - name: Install apt packages + apt: + pkg: "{{ item }}" + state: "latest" + update_cache: yes + register: install_packages + become: yes + until: install_packages|success + retries: 5 + delay: 2 + with_items: + - qemu-utils + - uuid-runtime + - curl + - kpartx + - python-yaml + - debootstrap + - qemu + - name: Install required pip packages + pip: + name: "{{ item }}" + state: "latest" + register: install_packages + until: install_packages|success + retries: 5 + delay: 2 + become: yes + with_items: + - diskimage-builder + - name: Ensure artifacts/images directory exists + file: + path: '{{ ansible_user_dir }}/test-images' + state: directory + - name: Build an amphora image for publishing + shell: >- + ./diskimage-create.sh -o {{ ansible_user_dir }}/test-images/test-only-amphora-x64-haproxy-{{ amphora_os }}-{{ amphora_os_release }}.qcow2 \ + -i {{ amphora_os }} \ + -d {{ amphora_os_release }} \ + -s {{ amphora_image_size | default(2) }} + args: + chdir: "{{ ansible_user_dir }}/src/git.openstack.org/openstack/octavia/diskimage-create" + tags: + - skip_ansible_lint diff --git a/zuul.d/jobs.yaml b/zuul.d/jobs.yaml index dda5ae8cd0..951e0d0c07 100644 --- a/zuul.d/jobs.yaml +++ b/zuul.d/jobs.yaml @@ -76,3 +76,29 @@ post-run: playbooks/legacy/octavia-v1-dsvm-scenario-lxd/post.yaml required-projects: - openstack/nova-lxd + +- job: + name: publish-openstack-octavia-amphora-image + parent: publish-openstack-artifacts + run: playbooks/image-build/run.yaml + post-run: playbooks/image-build/post.yaml + required-projects: + - openstack/diskimage-builder + - openstack/octavia +- job: + name: publish-openstack-octavia-amphora-image-ubuntu + parent: publish-openstack-octavia-amphora-image + description: | + Publish Ubuntu-based amphora image to tarballs.o.o. + vars: + amphora_os: ubuntu + amphora_os_release: xenial +- job: + name: publish-openstack-octavia-amphora-image-centos + parent: publish-openstack-octavia-amphora-image + description: | + Publish CentOS-based amphora image to tarballs.o.o. + vars: + amphora_os: centos + amphora_image_size: 3 + amphora_os_release: 7 diff --git a/zuul.d/projects.yaml b/zuul.d/projects.yaml index 22dcf993a1..6f520ba914 100644 --- a/zuul.d/projects.yaml +++ b/zuul.d/projects.yaml @@ -66,3 +66,10 @@ jobs: - octavia-v1-dsvm-scenario-lxd: branches: ^(?!stable/ocata).*$ + periodic: + jobs: + - publish-openstack-octavia-amphora-image-ubuntu: + branches: ^(?!stable/.*).*$ + - publish-openstack-octavia-amphora-image-centos: + branches: ^(?!stable/.*).*$ +