This repository has been archived on 2024-05-02. You can view files and clone it, but cannot push or open issues or pull requests.
omni-ansible/tasks/docker/build.yml

46 lines
1.2 KiB
YAML

---
- name: Download source
block:
- name: Clone repositories
when: item.value.build is defined
git:
repo: "{{ item.value.build.repository }}"
dest: /tmp/{{ item.key }}
version: "{{ item.value.build.version }}"
accept_hostkey: true
loop: "{{ omni_compose_apps | dict2items }}"
loop_control:
label: "{{ item.key }}"
rescue:
- name: Remove existing repository downloads
file:
path: /tmp/{{ item.key }}
state: absent
loop: "{{ omni_compose_apps | dict2items }}"
loop_control:
label: "{{ item.key }}"
- name: Clone repositories
when: item.value.build is defined
git:
repo: "{{ item.value.build.repository }}"
dest: /tmp/{{ item.key }}
version: "{{ item.value.build.version }}"
accept_hostkey: true
loop: "{{ omni_compose_apps | dict2items }}"
loop_control:
label: "{{ item.key }}"
- name: Build image
when: item.value.build is defined
docker_image:
source: build
name: "{{ item.key }}"
tag: "{{ item.value.build.version }}"
build:
path: /tmp/{{ item.key }}
rm: true
loop: "{{ omni_compose_apps | dict2items }}"
loop_control:
label: "{{ item.key }}"