split Woodpecker into separate main + pyswiss pipelines; added deploy-prod tag-triggered step for earthmanrpg.com cutover
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
111
.woodpecker/main.yaml
Normal file
111
.woodpecker/main.yaml
Normal file
@@ -0,0 +1,111 @@
|
||||
services:
|
||||
- name: postgres
|
||||
image: postgres:16
|
||||
environment:
|
||||
POSTGRES_DB: python_tdd_test
|
||||
POSTGRES_USER: postgres
|
||||
POSTGRES_PASSWORD: postgres
|
||||
|
||||
- name: redis
|
||||
image: redis:7
|
||||
|
||||
steps:
|
||||
- name: test-UTs-n-ITs
|
||||
image: python:3.13-slim
|
||||
environment:
|
||||
DATABASE_URL: postgresql://postgres:postgres@postgres/python_tdd_test
|
||||
CELERY_BROKER_URL: redis://redis:6379/0
|
||||
REDIS_URL: redis://redis:6379/1
|
||||
commands:
|
||||
- pip install -r requirements.txt
|
||||
- cd ./src
|
||||
- python manage.py test apps
|
||||
when:
|
||||
- event: push
|
||||
|
||||
- name: test-two-browser-FTs
|
||||
image: gitea.earthmanrpg.me/discoman/python-tdd-ci:latest
|
||||
environment:
|
||||
HEADLESS: 1
|
||||
CELERY_BROKER_URL: redis://redis:6379/0
|
||||
REDIS_URL: redis://redis:6379/1
|
||||
STRIPE_SECRET_KEY:
|
||||
from_secret: stripe_secret_key
|
||||
STRIPE_PUBLISHABLE_KEY:
|
||||
from_secret: stripe_publishable_key
|
||||
commands:
|
||||
- pip install -r requirements.txt
|
||||
- cd ./src
|
||||
- python manage.py collectstatic --noinput
|
||||
- python manage.py test functional_tests --tag=two-browser
|
||||
- python manage.py test functional_tests --tag=channels
|
||||
when:
|
||||
- event: push
|
||||
|
||||
- name: test-FTs
|
||||
image: gitea.earthmanrpg.me/discoman/python-tdd-ci:latest
|
||||
environment:
|
||||
HEADLESS: 1
|
||||
CELERY_BROKER_URL: redis://redis:6379/0
|
||||
REDIS_URL: redis://redis:6379/1
|
||||
STRIPE_SECRET_KEY:
|
||||
from_secret: stripe_secret_key
|
||||
STRIPE_PUBLISHABLE_KEY:
|
||||
from_secret: stripe_publishable_key
|
||||
commands:
|
||||
- pip install -r requirements.txt
|
||||
- cd ./src
|
||||
- python manage.py collectstatic --noinput
|
||||
- python manage.py test functional_tests --parallel --exclude-tag=channels --exclude-tag=two-browser
|
||||
when:
|
||||
- event: push
|
||||
|
||||
- name: screendumps
|
||||
image: gitea.earthmanrpg.me/discoman/python-tdd-ci:latest
|
||||
commands:
|
||||
- cat ./src/functional_tests/screendumps/*.html || echo "No screendumps found"
|
||||
when:
|
||||
- event: push
|
||||
status: failure
|
||||
|
||||
- name: build-and-push
|
||||
image: docker:cli
|
||||
environment:
|
||||
REGISTRY_PASSWORD:
|
||||
from_secret: gitea_registry_password
|
||||
commands:
|
||||
- echo "$REGISTRY_PASSWORD" | docker login gitea.earthmanrpg.me -u discoman --password-stdin
|
||||
- docker build -t gitea.earthmanrpg.me/discoman/gamearray:latest .
|
||||
- docker push gitea.earthmanrpg.me/discoman/gamearray:latest
|
||||
when:
|
||||
- branch: main
|
||||
event: push
|
||||
|
||||
- name: deploy-staging
|
||||
image: alpine
|
||||
environment:
|
||||
SSH_KEY:
|
||||
from_secret: deploy_ssh_key
|
||||
commands:
|
||||
- apk add --no-cache openssh-client
|
||||
- mkdir -p ~/.ssh
|
||||
- printf '%s\n' "$SSH_KEY" > ~/.ssh/id_ed25519
|
||||
- chmod 600 ~/.ssh/id_ed25519
|
||||
- ssh -o StrictHostKeyChecking=no discoman@staging.earthmanrpg.me /opt/gamearray/deploy.sh
|
||||
when:
|
||||
- branch: main
|
||||
event: push
|
||||
|
||||
- name: deploy-prod
|
||||
image: alpine
|
||||
environment:
|
||||
SSH_KEY:
|
||||
from_secret: deploy_ssh_key
|
||||
commands:
|
||||
- apk add --no-cache openssh-client
|
||||
- mkdir -p ~/.ssh
|
||||
- printf '%s\n' "$SSH_KEY" > ~/.ssh/id_ed25519
|
||||
- chmod 600 ~/.ssh/id_ed25519
|
||||
- ssh -o StrictHostKeyChecking=no discoman@staging.earthmanrpg.me /opt/gamearray/deploy.sh
|
||||
when:
|
||||
- event: tag
|
||||
27
.woodpecker/pyswiss.yaml
Normal file
27
.woodpecker/pyswiss.yaml
Normal file
@@ -0,0 +1,27 @@
|
||||
steps:
|
||||
- name: test-pyswiss
|
||||
image: python:3.13-slim
|
||||
environment:
|
||||
SWISSEPH_PATH: /tmp/ephe
|
||||
commands:
|
||||
- apt-get update -qq && apt-get install -y -q gcc g++
|
||||
- pip install -r pyswiss/requirements.txt
|
||||
- cd ./pyswiss
|
||||
- python manage.py test apps.charts
|
||||
when:
|
||||
- event: push
|
||||
|
||||
- name: deploy-pyswiss
|
||||
image: alpine
|
||||
environment:
|
||||
SSH_KEY:
|
||||
from_secret: pyswiss_deploy
|
||||
commands:
|
||||
- apk add --no-cache openssh-client
|
||||
- mkdir -p ~/.ssh
|
||||
- printf '%s\n' "$SSH_KEY" > ~/.ssh/id_ed25519
|
||||
- chmod 600 ~/.ssh/id_ed25519
|
||||
- ssh -o StrictHostKeyChecking=no discoman@167.172.154.66 ~/deploy.sh
|
||||
when:
|
||||
- branch: main
|
||||
event: push
|
||||
Reference in New Issue
Block a user