Add deployment-time build tooling for custom docker images

This commit is contained in:
2021-01-15 00:31:07 -05:00
parent b0612af979
commit 8bfb365dfd
3 changed files with 34 additions and 0 deletions

23
tasks/docker/build.yml Normal file
View File

@@ -0,0 +1,23 @@
---
- name: Clone repositories
when: item.value.build is defined
git:
dest: /tmp/{{ item.key }}
repo: "{{ item.value.build.repository }}"
version: "{{ item.value.build.version }}"
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 }}"