62 lines
1.6 KiB
YAML
62 lines
1.6 KiB
YAML
- name: Build containers
|
|
hosts: localhost
|
|
gather_facts: false
|
|
vars:
|
|
force: false
|
|
force_rm: false
|
|
cache: false
|
|
repository: tiptop:5000
|
|
|
|
tasks:
|
|
#- name: Read conf
|
|
# ansible.builtin.include_vars:
|
|
# file: prod.yaml
|
|
# name: conf
|
|
|
|
- name: Using the variables
|
|
ansible.builtin.debug:
|
|
var: force_rm
|
|
|
|
- name: Build the base image, only with python dependencies
|
|
containers.podman.podman_image:
|
|
name: treetrail-backend-deps
|
|
state: build
|
|
path: "{{ playbook_dir }}"
|
|
build:
|
|
format: oci
|
|
force_rm: "{{ force_rm }}"
|
|
cache: "{{ cache }}"
|
|
file: Containerfile.deps
|
|
push: true
|
|
push_args:
|
|
dest: "{{ repository }}/treetrail-backend-deps"
|
|
|
|
- name: Build a backend base container image, with sources in /src
|
|
containers.podman.podman_image:
|
|
name: treetrail-backend-base
|
|
state: build
|
|
force: true
|
|
path: "{{ playbook_dir }}"
|
|
build:
|
|
format: oci
|
|
force_rm: "{{ force_rm }}"
|
|
cache: "{{ cache }}"
|
|
file: Containerfile.base
|
|
push: true
|
|
push_args:
|
|
dest: "{{ repository }}/treetrail-backend-base"
|
|
|
|
- name: Build the prod container image
|
|
containers.podman.podman_image:
|
|
name: treetrail-backend
|
|
state: build
|
|
force: true
|
|
path: "{{ playbook_dir }}"
|
|
build:
|
|
format: oci
|
|
force_rm: "{{ force_rm }}"
|
|
cache: "{{ cache }}"
|
|
file: Containerfile
|
|
push: true
|
|
push_args:
|
|
dest: "{{ repository }}/treetrail-backend"
|