manila-image-elements/playbooks/manila-buildimage-generic/run.yaml

40 lines
1.3 KiB
YAML

- hosts: all
tasks:
- name: Run tools/gate/build-images generic
command: bash -xe tools/gate/build-images generic
args:
chdir: '{{ zuul.project.src_dir }}'
- name: create images directory
file:
path: '{{ zuul.project.src_dir }}/images'
state: directory
mode: 0755
- name: Collect git tag
command: git describe --tags
args:
chdir: '{{ zuul.project.src_dir }}'
register: tagoutput
- name: show directory contents after the build
command: ls -lrt
args:
chdir: '{{ zuul.project.src_dir }}'
- name: get the source directory
command: pwd
args:
chdir: '{{ zuul.project.src_dir }}'
register: src_dir
- name: hard link to image from images directory using tag
file:
src: '{{ src_dir.stdout }}/manila-service-image.qcow2'
dest: '{{ src_dir.stdout }}/images/manila-service-image-{{ tagoutput.stdout }}.qcow2'
state: hard
- name: now symlink using "master" in place of tag
file:
src: '{{ src_dir.stdout }}/images/manila-service-image-{{ tagoutput.stdout }}.qcow2'
dest: '{{ src_dir.stdout }}/images/manila-service-image-master.qcow2'
state: link
- name: show contents of the image directory
command: ls -lrt
args:
chdir: '{{ src_dir.stdout }}/images'