From a1a499b370eaa5959f364f984f6e7ded8fedf86f Mon Sep 17 00:00:00 2001 From: phil Date: Fri, 6 Dec 2024 03:16:21 +0100 Subject: [PATCH 1/3] Containers: use public registry --- Containerfile | 2 +- Containerfile.ci | 2 +- Containerfile.deps | 2 +- Containerfile.full_copy | 2 +- Containerfile.trixie_python | 2 +- build.yaml | 7 ++++--- 6 files changed, 9 insertions(+), 8 deletions(-) diff --git a/Containerfile b/Containerfile index 07fadf4..3c5b98a 100644 --- a/Containerfile +++ b/Containerfile @@ -1,6 +1,6 @@ # Build: podman build -t code.philo.ydns.eu/philorg/treetrail-backend-base -f Containerfile.base -FROM tiptop:5000/treetrail-backend-deps +FROM code.philo.ydns.eu/philorg/treetrail-backend-deps ENV PYTHONPATH $UV_PROJECT_ENVIRONMENT/lib/python3.12/site-packages ARG APP_VERSION=0.0.0 diff --git a/Containerfile.ci b/Containerfile.ci index 76b217f..160472c 100644 --- a/Containerfile.ci +++ b/Containerfile.ci @@ -1,6 +1,6 @@ # Build: podman build -t code.philo.ydns.eu/philorg/treetrail-backend-ci -f Containerfile.ci -FROM tiptop:5000/python-ci +FROM code.philo.ydns.eu/philorg/python-ci COPY ./pyproject.toml ./README.md ./uv.lock /_lock/ diff --git a/Containerfile.deps b/Containerfile.deps index c80eeff..f78d8db 100644 --- a/Containerfile.deps +++ b/Containerfile.deps @@ -1,6 +1,6 @@ # Build: podman build -t code.philo.ydns.eu/philorg/treetrail-backend-deps -f Containerfile.deps -FROM tiptop:5000/trixie_python +FROM code.philo.ydns.eu/philorg/trixie_python COPY ./pyproject.toml ./README.md ./uv.lock /_lock/ diff --git a/Containerfile.full_copy b/Containerfile.full_copy index c725c87..7fb7d55 100644 --- a/Containerfile.full_copy +++ b/Containerfile.full_copy @@ -1,5 +1,5 @@ # Build: podman build -t code.philo.ydns.eu/philorg/treetrail-backend-full -f Containerfile.full_copy -FROM localhost/trixie_python +FROM code.philo.ydns.eu/philorg/trixie_python ENV PYTHONPATH $UV_PROJECT_ENVIRONMENT/lib/python3.12/site-packages ENV PATH=/app/bin:$PATH diff --git a/Containerfile.trixie_python b/Containerfile.trixie_python index 34ae5ff..1adb8f6 100644 --- a/Containerfile.trixie_python +++ b/Containerfile.trixie_python @@ -1,6 +1,6 @@ # Build: podman build -t code.philo.ydns.eu/philorg/trixie_python -f Containerfile.trixie_python -FROM debian:trixie-slim +FROM docker.io/library/debian:trixie-slim RUN < Date: Fri, 6 Dec 2024 03:34:01 +0100 Subject: [PATCH 2/3] Playbook: build and publish ci image --- build.yaml | 35 ++++++++++++++++++++++++++--------- 1 file changed, 26 insertions(+), 9 deletions(-) diff --git a/build.yaml b/build.yaml index bb2ad70..b76339d 100644 --- a/build.yaml +++ b/build.yaml @@ -17,9 +17,31 @@ ansible.builtin.debug: var: force_rm + - name: Get the version from git + command: git describe --dirty --tags + register: version + args: + chdir: "{{ playbook_dir }}" + + - name: Build the base CI image + containers.podman.podman_image: + name: treetrail-backend-ci + tag: "{{ version }}" + state: build + path: "{{ playbook_dir }}" + build: + format: oci + force_rm: "{{ force_rm }}" + cache: "{{ cache }}" + file: Containerfile.ci + push: true + push_args: + dest: "{{ repository }}/{{ organisation }}/treetrail-backend-ci" + - name: Build the base image, only with python dependencies containers.podman.podman_image: name: treetrail-backend-deps + tag: "{{ version }}" state: build path: "{{ playbook_dir }}" build: @@ -29,17 +51,12 @@ file: Containerfile.deps push: true push_args: - dest: "{{ repository }}/{{ organisation }}/treetrail-backend-deps" - - - name: Get the version from git - command: git describe --dirty --tags - register: version - args: - chdir: "{{ playbook_dir }}" + dest: "{{ repository }}/{{ organisation }}" - name: Build the backend container image containers.podman.podman_image: - name: "treetrail-backend:{{ version.stdout }}" + name: treetrail-backend + tag: "{{ version.stdout }}" state: build force: true path: "{{ playbook_dir }}" @@ -51,4 +68,4 @@ extra_args: "--build-arg APP_VERSION={{ version.stdout }}" push: true push_args: - dest: "{{ repository }}/{{ organisation }}/treetrail-backend:{{ version.stdout }}" + dest: "{{ repository }}/{{ organisation }}" From 425aaf9dc06732f0ca989d5880416d741bd65346 Mon Sep 17 00:00:00 2001 From: phil Date: Fri, 6 Dec 2024 03:35:08 +0100 Subject: [PATCH 3/3] Playbook: fix build and publish ci image --- build.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/build.yaml b/build.yaml index b76339d..92eaf0d 100644 --- a/build.yaml +++ b/build.yaml @@ -26,7 +26,7 @@ - name: Build the base CI image containers.podman.podman_image: name: treetrail-backend-ci - tag: "{{ version }}" + tag: "{{ version.stdout }}" state: build path: "{{ playbook_dir }}" build: @@ -41,7 +41,7 @@ - name: Build the base image, only with python dependencies containers.podman.podman_image: name: treetrail-backend-deps - tag: "{{ version }}" + tag: "{{ version.stdout }}" state: build path: "{{ playbook_dir }}" build: