Add playbook for building the images
Some checks failed
/ build (push) Failing after 15s

This commit is contained in:
phil 2024-10-30 02:07:05 +01:00
parent 9ca2ea638e
commit 114201d561
8 changed files with 80 additions and 26 deletions

62
build.yaml Normal file
View file

@ -0,0 +1,62 @@
- 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: "{{ force }}"
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: "{{ force }}"
path: "{{ playbook_dir }}"
build:
format: oci
force_rm: "{{ force_rm }}"
cache: "{{ cache }}"
file: Containerfile
push: true
push_args:
dest: "{{ repository }}/treetrail-backend"