swarmpit/.woodpecker.yml

64 lines
1.8 KiB
YAML

labels:
location: manager
clone:
git:
image: woodpeckerci/plugin-git
settings:
partial: false
depth: 1
steps:
# Deploy Config if there are relevant changes
deploy-config:
name: deploy-config
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 "Deploying updated stack configuration"
- docker stack deploy --with-registry-auth -c ./stack.yml $${CI_REPO_NAME}
when:
branch: main
event: push
# Wait step to allow the deployment to stabilize before testing
wait:
name: wait-for-deploy
image: woodpeckerci/plugin-git
commands:
- echo "Waiting for five minutes before running tests"
- sleep 300 # Waits for five minutes
when:
branch: main
event: push
# Run Post-Deployment Smoke Tests
run-post-deploy-smoke-tests:
name: run-post-deploy-smoke-tests
image: git.nixc.us/colin/playwright:latest
environment:
REGISTRY_USER:
from_secret: REGISTRY_USER
REGISTRY_PASSWORD:
from_secret: REGISTRY_PASSWORD
SWARM_USERNAME:
from_secret: SWARM_USERNAME
SWARM_PASSWORD:
from_secret: SWARM_PASSWORD
when:
branch: main
event: push