🤖 feat: implement trunk-based CI/CD with local testing
- Designed trunk-based development workflow with branch protection - Added workflow validation job to prevent main branch breaks - Integrated act (GitHub Actions runner) for local Gitea workflow testing - Created unified CI/CD script interface (scripts/cicd.sh) - Added YAML lint configuration with practical limits (400 chars) - Organized all CI/CD scripts under scripts/cicd/ directory - Confirmed Gitea/GitHub Actions compatibility via local testing - Updated ADR 0017 with implementation details and test results - Enhanced documentation with local development workflow See ADR-0017 for complete trunk-based development workflow documentation. See ADR-0016 for CI/CD pipeline design.
This commit is contained in:
76
scripts/cicd.sh
Executable file
76
scripts/cicd.sh
Executable file
@@ -0,0 +1,76 @@
|
||||
#!/bin/bash
|
||||
# DanceLessonsCoach CI/CD Management Script
|
||||
# Unified interface for all CI/CD operations
|
||||
|
||||
set -e
|
||||
|
||||
SCRIPTS_DIR="$(dirname "$0")/cicd"
|
||||
|
||||
echo "🚀 DanceLessonsCoach CI/CD Management"
|
||||
echo "===================================="
|
||||
echo ""
|
||||
|
||||
if [ $# -eq 0 ]; then
|
||||
echo "Available commands:"
|
||||
echo " validate - Validate CI/CD workflow structure"
|
||||
echo " test-simple - Test workflow locally without Gitea"
|
||||
echo " test-local - Test local setup with Gitea configuration"
|
||||
echo " test-docker - Test with docker compose (requires Gitea runner)"
|
||||
echo " check-status - Check pipeline status on Gitea"
|
||||
echo " help - Show this help message"
|
||||
echo ""
|
||||
echo "Usage: $0 <command>"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
COMMAND="$1"
|
||||
shift
|
||||
|
||||
case "$COMMAND" in
|
||||
validate)
|
||||
echo "🔍 Validating CI/CD workflow..."
|
||||
"$SCRIPTS_DIR/validate-workflow.sh"
|
||||
;;
|
||||
|
||||
test-simple)
|
||||
echo "🧪 Running simple CI/CD test (no Gitea required)..."
|
||||
"$SCRIPTS_DIR/test-cicd-simple.sh"
|
||||
;;
|
||||
|
||||
test-local)
|
||||
echo "🧪 Testing local CI/CD setup..."
|
||||
"$SCRIPTS_DIR/test-cicd-local.sh"
|
||||
;;
|
||||
|
||||
test-docker)
|
||||
echo "🐳 Testing with docker compose..."
|
||||
"$SCRIPTS_DIR/test-cicd-docker.sh"
|
||||
;;
|
||||
|
||||
test-act)
|
||||
echo "🎭 Testing Gitea workflows with GitHub Actions runner..."
|
||||
"$SCRIPTS_DIR/test-act-local.sh"
|
||||
;;
|
||||
|
||||
check-status)
|
||||
echo "🔍 Checking pipeline status..."
|
||||
"$SCRIPTS_DIR/check-pipeline-status.sh"
|
||||
;;
|
||||
|
||||
help|--help|-h)
|
||||
echo "Available commands:"
|
||||
echo " validate - Validate CI/CD workflow structure"
|
||||
echo " test-simple - Test workflow locally without Gitea"
|
||||
echo " test-local - Test local setup with Gitea configuration"
|
||||
echo " test-docker - Test with docker compose (requires Gitea runner)"
|
||||
echo " test-act - Test Gitea workflows with GitHub Actions runner"
|
||||
echo " check-status - Check pipeline status on Gitea"
|
||||
echo " help - Show this help message"
|
||||
;;
|
||||
|
||||
*)
|
||||
echo "❌ Unknown command: $COMMAND"
|
||||
echo "Run '$0 help' for available commands"
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
Reference in New Issue
Block a user