Compare commits

...

2 commits

Author SHA1 Message Date
ffd3e99ecc CI: add Python package build
Some checks failed
/ test (push) Successful in 25s
/ build (push) Failing after 4s
2024-12-06 05:04:39 +01:00
48507cc01c Add database container image build 2024-12-06 05:03:55 +01:00
3 changed files with 42 additions and 11 deletions

View file

@ -72,16 +72,6 @@ jobs:
VERSION: ${{ steps.version.outputs.version }}
run: sed "s/0.0.0/${VERSION}/" -i pyproject.toml
- name: Build python package
if: fromJSON(steps.builder.outputs.run)
run: uv build --wheel
- name: Publish Python package (home)
if: fromJSON(steps.builder.outputs.run)
env:
LOCAL_PYPI_TOKEN: ${{ secrets.LOCAL_PYPI_TOKEN }}
run: uv publish --publish-url https://code.philo.ydns.eu/api/packages/philorg/pypi --token $LOCAL_PYPI_TOKEN
- name: Workaround for bug of podman-login
if: fromJSON(steps.builder.outputs.run)
run: |
@ -117,3 +107,18 @@ jobs:
registry: "docker://${{ vars.REGISTRY }}/${{ vars.ORGANISATION }}"
image: treetrail-backend
tags: ${{ steps.version.outputs.version }}
- name: Install uv
uses: astral-sh/setup-uv@4
with:
version: "0.5.5"
- name: Build python package
if: fromJSON(steps.builder.outputs.run)
run: uv build --wheel
- name: Publish Python package (home)
if: fromJSON(steps.builder.outputs.run)
env:
LOCAL_PYPI_TOKEN: ${{ secrets.LOCAL_PYPI_TOKEN }}
run: uv publish --publish-url https://code.philo.ydns.eu/api/packages/philorg/pypi --token $LOCAL_PYPI_TOKEN

4
Containerfile.database Normal file
View file

@ -0,0 +1,4 @@
FROM docker.io/postgis/postgis:17-3.5-alpine
ENV POSTGRES_USER treetrail
ENV POSTGRES_PASSWORD treetrail

View file

@ -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 }}"