Add deployment-time build tooling for custom docker images

This commit is contained in:
Ethan Paul 2021-01-15 00:31:07 -05:00
parent b0612af979
commit 8bfb365dfd
No known key found for this signature in database
GPG Key ID: C5F5542B54A4D9C6
3 changed files with 34 additions and 0 deletions

View File

@ -23,6 +23,14 @@
- import_playbook: initialize.yml - import_playbook: initialize.yml
- name: Build image
hosts: virtualization
vars_files:
- vars/applications.yml
tasks:
- import_tasks: tasks/docker/build.yml
- name: Configure datastore - name: Configure datastore
hosts: jupiter hosts: jupiter
vars_files: vars_files:

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 }}"

View File

@ -85,6 +85,9 @@ omni_compose_apps:
versions: versions:
default: "5.12" default: "5.12"
scipio: scipio:
build:
repository: git@github.com:tjyork/Scipio.git
version: 0.2.0
datastore: /appdata/scipio datastore: /appdata/scipio
account: account:
name: mech_scipio name: mech_scipio