Version file added dynamically (workaround as uv does not have this feature yet)
All checks were successful
/ test (push) Successful in 17s
/ build (push) Successful in 19s

Tag container image with playbook
Importable module with python -m treetrail
This commit is contained in:
phil 2024-11-04 03:58:58 +01:00
parent 2d0b788728
commit 1693662e75
11 changed files with 66 additions and 29 deletions

View file

@ -1,8 +1,7 @@
- name: Build containers
- name: Build containers images
hosts: localhost
gather_facts: false
vars:
force: false
force_rm: false
cache: false
repository: tiptop:5000
@ -31,9 +30,15 @@
push_args:
dest: "{{ repository }}/treetrail-backend-deps"
- name: Get the version from git
command: git describe --dirty --tags
register: version
args:
chdir: "{{ playbook_dir }}"
- name: Build the backend container image
containers.podman.podman_image:
name: treetrail-backend
name: "treetrail-backend:{{ version.stdout }}"
state: build
force: true
path: "{{ playbook_dir }}"
@ -42,6 +47,7 @@
force_rm: "{{ force_rm }}"
cache: "{{ cache }}"
file: Containerfile
extra_args: "--build-arg APP_VERSION={{ version.stdout }}"
push: true
push_args:
dest: "{{ repository }}/treetrail-backend"
dest: "{{ repository }}/treetrail-backend:{{ version.stdout }}"