aeff89ce24
The secret needed to be updated to make this work. Now we are pushing to quay.io as well, both under the same loci namespace Change-Id: I086aec21c2ebe69bcdf0aa25749280d8878f946d
73 lines
2.2 KiB
YAML
73 lines
2.2 KiB
YAML
- hosts: all
|
|
tasks:
|
|
- include_vars: vars.yaml
|
|
|
|
# NOTE(SamYaple): This process is so we can take advantage of the infra
|
|
# DockerHub mirroring as configured through the Docker daemon. We do this
|
|
# instead of calling fetch_wheels initially. All-in-all this saves
|
|
# bandwidth and time.
|
|
- name: Gather wheels to local registry
|
|
block:
|
|
- docker_image:
|
|
name: loci/requirements
|
|
tag: "{{ branch }}-{{ item.name }}"
|
|
repository: 172.17.0.1:5000/loci/requirements
|
|
push: yes
|
|
with_items: "{{ distros }}"
|
|
async: 1000
|
|
poll: 0
|
|
register: pull
|
|
- async_status:
|
|
jid: "{{ item.ansible_job_id }}"
|
|
with_items: "{{ pull.results }}"
|
|
register: pull_result
|
|
until:
|
|
- pull_result.finished is defined
|
|
- pull_result.finished
|
|
retries: 1000
|
|
delay: 5
|
|
when: project != 'requirements'
|
|
|
|
- name: Build base images
|
|
block:
|
|
- docker_image:
|
|
path: "{{ loci_src_dir }}/dockerfiles/{{ item.name }}"
|
|
name: base
|
|
tag: "{{ item.name }}"
|
|
buildargs: "{{ item.buildargs.base }}"
|
|
with_items: "{{ distros }}"
|
|
async: 1000
|
|
poll: 0
|
|
register: base
|
|
- async_status:
|
|
jid: "{{ item.ansible_job_id }}"
|
|
with_items: "{{ base.results }}"
|
|
register: base_result
|
|
until:
|
|
- base_result.finished is defined
|
|
- base_result.finished
|
|
retries: 1000
|
|
delay: 5
|
|
|
|
- name: Build project images
|
|
block:
|
|
- docker_image:
|
|
path: "{{ loci_src_dir }}"
|
|
name: loci/{{ project }}
|
|
tag: "{{ branch }}-{{ item.name }}"
|
|
pull: False
|
|
buildargs: "{{ item.buildargs.project }}"
|
|
with_items: "{{ distros }}"
|
|
async: 1000
|
|
poll: 0
|
|
register: build
|
|
- async_status:
|
|
jid: "{{ item.ansible_job_id }}"
|
|
with_items: "{{ build.results }}"
|
|
register: build_result
|
|
until:
|
|
- build_result.finished is defined
|
|
- build_result.finished
|
|
retries: 1000
|
|
delay: 5
|