loci/playbooks/loci-builder.yaml

73 lines
2.2 KiB
YAML

- hosts: all
tasks:
- include_vars: vars.yaml
- name: Ensure dep files are sorted
shell: "grep -v '^#' {{ loci_src_dir }}/{{ item }} | sort --check"
loop:
- "bindep.txt"
- "pydep.txt"
environment:
LC_ALL: C
- name: Gather wheels to local registry
block:
- docker_image:
name: loci/requirements
tag: "{{ item.release }}-{{ item.name }}"
repository: 172.17.0.1:5000/loci/requirements
push: yes
with_items: "{{ distros }}"
when: &condition >
supported_releases is undefined or
item.release in supported_releases
when:
- reuse_requirements | bool
- project != 'requirements'
- name: Build base images
block:
- name: "Build base image for {{ item.name }}"
docker_image:
name: base
tag: "{{ item.name }}"
source: build
build:
args: "{{ item.buildargs.base }}"
path: "{{ loci_src_dir }}/dockerfiles/{{ item.name }}"
with_items: "{{ distros }}"
when: *condition
- name: Build requirements image
block:
- name: "Build requirements image for {{ item.name }}"
docker_image:
name: loci/requirements
tag: "{{ item.release }}-{{ item.name }}"
repository: 172.17.0.1:5000/loci/requirements
push: yes
source: build
build:
args: "{{ item.buildargs.requirements }}"
path: "{{ loci_src_dir }}"
pull: no
with_items: "{{ distros }}"
when: *condition
when:
- (not reuse_requirements) | bool
- project != 'requirements'
- name: Build project images
block:
- name: "Build {{ project }} image for {{ item.name }}"
docker_image:
name: loci/{{ project }}
tag: "{{ item.release }}-{{ item.name }}"
source: build
build:
args: "{{ item.buildargs.project }}"
path: "{{ loci_src_dir }}"
pull: no
with_items: "{{ distros }}"
when: *condition