feat: implement full CI/CD pipeline with staged deployments
- PR workflow: build, deploy to CI site, wait for health, run acceptance tests - Release workflow: deploy to dev using mounted compose path with health check - Add deploy-prod workflow (workflow_dispatch) for human-gated prod deployment - Add just recipes: deploy-prod, status (view current image tags across envs) - Runners now have /apps mount for access to all environment compose files
This commit is contained in:
@@ -240,6 +240,50 @@ workflow-status:
|
||||
@echo "Test Workflow: Runs unit tests on all branch pushes"
|
||||
@echo "Release Workflow: Runs on main branch pushes (version bump + Docker build)"
|
||||
|
||||
# --- Production Deployment ---
|
||||
|
||||
# Deploy a specific version to production (human gate)
|
||||
# Usage: just deploy-prod v0.1.21
|
||||
deploy-prod version:
|
||||
@echo "Deploying {{version}} to production..."
|
||||
@echo "This requires the image to already be pushed to the registry."
|
||||
@echo ""
|
||||
@read -p "Have you verified this version works in dev? (y/N) " confirm; \
|
||||
if [ "$$confirm" != "y" ]; then \
|
||||
echo "Cancelled. Please verify in dev first."; \
|
||||
exit 1; \
|
||||
fi
|
||||
cd /apps/youthful_simon && \
|
||||
sed -i "s|image: docker.notsosm.art/euchre-camp:[a-zA-Z0-9.-]*|image: docker.notsosm.art/euchre-camp:{{version}}|" docker-compose.yml && \
|
||||
sed -i "s|image: euchre-camp/euchre-camp:[a-zA-Z0-9.-]*|image: docker.notsosm.art/euchre-camp:{{version}}|" docker-compose.yml && \
|
||||
docker compose pull app && \
|
||||
docker compose up -d app && \
|
||||
echo "Waiting for production site to be healthy..." && \
|
||||
for i in {1..30}; do \
|
||||
if curl -sf https://euchre.notsosm.art/api/health > /dev/null 2>&1; then \
|
||||
echo "✅ Production successfully deployed with version {{version}}"; \
|
||||
exit 0; \
|
||||
fi; \
|
||||
sleep 0.5; \
|
||||
done && \
|
||||
echo "❌ Production deployment failed - health check timed out"; \
|
||||
docker compose logs app; \
|
||||
exit 1
|
||||
|
||||
# Show current deployment status across all environments
|
||||
status:
|
||||
@echo "=== EuchreCamp Deployment Status ==="
|
||||
@echo ""
|
||||
@echo "CI Site (euchre-camp-ci):"
|
||||
@grep "image:" /apps/euchre_camp_ci/docker-compose.yml | head -1
|
||||
@echo ""
|
||||
@echo "Dev Site (euchre-camp-dev):"
|
||||
@grep "image:" /apps/intelligent_silasak/docker-compose.yml | head -1
|
||||
@echo ""
|
||||
@echo "Prod Site (euchre-camp):"
|
||||
@grep "image:" /apps/youthful_simon/docker-compose.yml | head -1
|
||||
@echo ""
|
||||
|
||||
# --- SDLC Database Operations ---
|
||||
|
||||
# Sync production data to development database (manual operation)
|
||||
|
||||
Reference in New Issue
Block a user