CI: switch to Woodpecker
This commit is contained in:
parent
cf94b1f768
commit
64d564f519
2 changed files with 100 additions and 0 deletions
70
.woodpecker/build.yaml
Normal file
70
.woodpecker/build.yaml
Normal file
|
@ -0,0 +1,70 @@
|
||||||
|
when:
|
||||||
|
- event: manual
|
||||||
|
- event: tag
|
||||||
|
|
||||||
|
depends_on:
|
||||||
|
- test
|
||||||
|
|
||||||
|
steps:
|
||||||
|
python_sync:
|
||||||
|
image: code.philo.ydns.eu/philorg/uv-geo
|
||||||
|
pull: true
|
||||||
|
volumes:
|
||||||
|
- uv-cache:/uv-cache
|
||||||
|
environment:
|
||||||
|
UV_CACHE_DIR: /uv-cache
|
||||||
|
UV_LINK_MODE: copy
|
||||||
|
commands:
|
||||||
|
- uv sync
|
||||||
|
|
||||||
|
python_build:
|
||||||
|
image: code.philo.ydns.eu/philorg/uv-geo
|
||||||
|
volumes:
|
||||||
|
- uv-cache:/uv-cache
|
||||||
|
environment:
|
||||||
|
UV_CACHE_DIR: /uv-cache
|
||||||
|
UV_LINK_MODE: copy
|
||||||
|
commands:
|
||||||
|
- uv build --wheel
|
||||||
|
- uv cache prune --ci
|
||||||
|
|
||||||
|
python_publish:
|
||||||
|
image: code.philo.ydns.eu/philorg/uv-geo
|
||||||
|
volumes:
|
||||||
|
- uv-cache:/uv-cache
|
||||||
|
environment:
|
||||||
|
UV_CACHE_DIR: /uv-cache
|
||||||
|
UV_LINK_MODE: copy
|
||||||
|
OWNER: philorg
|
||||||
|
REGISTRY_URL: https://code.philo.ydns.eu
|
||||||
|
REGISTRY_TOKEN:
|
||||||
|
from_secret: registry_token
|
||||||
|
commands:
|
||||||
|
- uv publish --publish-url $REGISTRY_URL/api/packages/$OWNER/pypi --token $REGISTRY_TOKEN dist/*.whl
|
||||||
|
failure: ignore
|
||||||
|
|
||||||
|
container_build_publish:
|
||||||
|
image: quay.io/podman/stable:latest
|
||||||
|
# Caution: This image is built daily. It might fill up your image store quickly.
|
||||||
|
#pull: true
|
||||||
|
volumes:
|
||||||
|
- containers:/var/lib/containers
|
||||||
|
- uv-cache:/uv-cache
|
||||||
|
# Fill in the trusted checkbox in Woodpecker's settings as well
|
||||||
|
privileged: true
|
||||||
|
environment:
|
||||||
|
UV_CACHE_DIR: /uv-cache
|
||||||
|
UV_LINK_MODE: copy
|
||||||
|
registry: code.philo.ydns.eu
|
||||||
|
org: philorg
|
||||||
|
container_name: gisaf-backend
|
||||||
|
registry_token:
|
||||||
|
from_secret: registry_token
|
||||||
|
commands:
|
||||||
|
# Login at the registry
|
||||||
|
- podman login -u __token__ --password $registry_token $registry
|
||||||
|
# Build the container image
|
||||||
|
- podman build --volume=/var/lib/containers:/var/lib/containers --tag $registry/$org/$container_name:latest --tag $registry/$org/$container_name:$CI_COMMIT_TAG .
|
||||||
|
# Push the image
|
||||||
|
- podman push $registry/$org/$container_name:latest
|
||||||
|
- podman push $registry/$org/$container_name:$CI_COMMIT_TAG
|
30
.woodpecker/test.yaml
Normal file
30
.woodpecker/test.yaml
Normal file
|
@ -0,0 +1,30 @@
|
||||||
|
when:
|
||||||
|
- event: push
|
||||||
|
branch: main
|
||||||
|
- event: manual
|
||||||
|
- event: tag
|
||||||
|
|
||||||
|
steps:
|
||||||
|
sync:
|
||||||
|
image: code.philo.ydns.eu/philorg/uv-geo
|
||||||
|
pull: true
|
||||||
|
volumes:
|
||||||
|
- uv-cache:/uv-cache
|
||||||
|
environment:
|
||||||
|
UV_CACHE_DIR: /uv-cache
|
||||||
|
UV_LINK_MODE: copy
|
||||||
|
commands:
|
||||||
|
- uv sync
|
||||||
|
|
||||||
|
test:
|
||||||
|
image: code.philo.ydns.eu/philorg/uv-geo
|
||||||
|
environment:
|
||||||
|
GISAF__DB__HOST: gisaf-database
|
||||||
|
commands:
|
||||||
|
# Initialize database
|
||||||
|
- .venv/bin/gisaf create-db
|
||||||
|
- .venv/bin/pytest -s tests/basic.py
|
||||||
|
|
||||||
|
services:
|
||||||
|
gisaf-database:
|
||||||
|
image: code.philo.ydns.eu/philorg/treetrail-database
|
Loading…
Add table
Add a link
Reference in a new issue