awx/tools/ansible/build.yml
Shane McDonald c9b53cf975
Refactor image_build and image_push roles
Primary changes are:

- Generalized variable names (remove "docker")
- Add explicit "push" variable rather than checking if the "registry" variable is defined.
- Allow for passing in version as build arg
2021-10-12 18:59:13 -04:00

26 lines
634 B
YAML

---
- name: Build AWX Docker Images
hosts: localhost
gather_facts: true
tasks:
- name: Get version from SCM if not explicitly provided
shell: |
python setup.py --version | cut -d + -f -1
args:
chdir: '../../'
register: setup_py_version
when: awx_version is not defined
- name: Set awx_version
set_fact:
awx_version: "{{ setup_py_version.stdout }}"
when: awx_version is not defined
- include_role:
name: dockerfile
- include_role:
name: image_build
- include_role:
name: image_push
when: push | default(false) | bool