From 48507cc01c87e2be46c49f73c86343acaf2be4a9 Mon Sep 17 00:00:00 2001 From: phil Date: Fri, 6 Dec 2024 05:03:55 +0100 Subject: [PATCH] Add database container image build --- Containerfile.database | 4 ++++ build.yaml | 24 +++++++++++++++++++++++- 2 files changed, 27 insertions(+), 1 deletion(-) create mode 100644 Containerfile.database diff --git a/Containerfile.database b/Containerfile.database new file mode 100644 index 0000000..5145954 --- /dev/null +++ b/Containerfile.database @@ -0,0 +1,4 @@ +FROM docker.io/postgis/postgis:17-3.5-alpine + +ENV POSTGRES_USER treetrail +ENV POSTGRES_PASSWORD treetrail diff --git a/build.yaml b/build.yaml index 92eaf0d..600f96a 100644 --- a/build.yaml +++ b/build.yaml @@ -13,17 +13,37 @@ # file: prod.yaml # name: conf + - name: Build the database image + tags: db + containers.podman.podman_image: + name: treetrail-database + state: build + path: "{{ playbook_dir }}" + build: + format: oci + force_rm: "{{ force_rm }}" + cache: "{{ cache }}" + file: Containerfile.database + push: true + push_args: + dest: "{{ repository }}/{{ organisation }}" + - name: Using the variables ansible.builtin.debug: var: force_rm - name: Get the version from git + tags: + - ci + - deps + - backend command: git describe --dirty --tags register: version args: chdir: "{{ playbook_dir }}" - name: Build the base CI image + tags: ci containers.podman.podman_image: name: treetrail-backend-ci tag: "{{ version.stdout }}" @@ -36,9 +56,10 @@ file: Containerfile.ci push: true push_args: - dest: "{{ repository }}/{{ organisation }}/treetrail-backend-ci" + dest: "{{ repository }}/{{ organisation }}" - name: Build the base image, only with python dependencies + tags: deps containers.podman.podman_image: name: treetrail-backend-deps tag: "{{ version.stdout }}" @@ -54,6 +75,7 @@ dest: "{{ repository }}/{{ organisation }}" - name: Build the backend container image + tags: backend containers.podman.podman_image: name: treetrail-backend tag: "{{ version.stdout }}"