forked from Nixius/authelia
1
0
Fork 0
ATLAS/.woodpecker.yml

85 lines
2.4 KiB
YAML

labels:
location: manager
clone:
git:
image: woodpeckerci/plugin-git
settings:
partial: false
depth: 1
recursive: true
steps:
# ss-atlas unit tests (runs on every push)
ss-atlas-test:
name: ss-atlas-test
image: golang:1.23-alpine
commands:
- cd docker/ss-atlas && go test ./...
when:
event: push
# Build and Push for Production
build-push-production:
name: build-push-production
image: woodpeckerci/plugin-docker-buildx
environment:
REGISTRY_USER:
from_secret: REGISTRY_USER
REGISTRY_PASSWORD:
from_secret: REGISTRY_PASSWORD
DOCKER_REGISTRY_USER:
from_secret: DOCKER_REGISTRY_USER
DOCKER_REGISTRY_PASSWORD:
from_secret: DOCKER_REGISTRY_PASSWORD
volumes:
- /var/run/docker.sock:/var/run/docker.sock
commands:
- echo "Logging into registries"
- echo "$${DOCKER_REGISTRY_PASSWORD}" | docker login -u "$${DOCKER_REGISTRY_USER}" --password-stdin
- echo "$${REGISTRY_PASSWORD}" | docker login -u "$${REGISTRY_USER}" --password-stdin git.nixc.us
- echo "Building and pushing application for production"
- docker compose -f docker-compose.production.yml build --no-cache
- docker compose -f docker-compose.production.yml push
when:
branch: main
event: [push, cron]
# Deploy Production
deploy-production:
name: deploy-production
image: woodpeckerci/plugin-docker-buildx
environment:
REGISTRY_USER:
from_secret: REGISTRY_USER
REGISTRY_PASSWORD:
from_secret: REGISTRY_PASSWORD
volumes:
- /var/run/docker.sock:/var/run/docker.sock
commands:
- echo "=== DEBUGGING CI WORKSPACE ==="
- pwd
- ls -la
- echo "=== CHECKING SCRIPTS DIRECTORY ==="
- ls -la scripts/ || echo "scripts directory not found"
- echo "=== AVAILABLE SHELLS ==="
- which bash || echo "bash not found"
- which sh || echo "sh not found"
- echo "=== ENVIRONMENT INFO ==="
- uname -a || echo "uname not available"
- echo "=== ATTEMPTING DEPLOYMENT ==="
- sh ./scripts/ci-deploy-production.sh
when:
branch: main
event: [push, cron]
# Post-Deployment Smoke Tests
post-deploy-smoke-tests:
name: run-post-deploy-smoke-tests
image: git.nixc.us/colin/playwright:latest
environment:
BASE_URL: https://git.nixc.us
when:
branch: main
event: push