🧪 test: add local Docker push workflow testing script
This commit is contained in:
54
scripts/test-docker-push.sh
Executable file
54
scripts/test-docker-push.sh
Executable file
@@ -0,0 +1,54 @@
|
||||
#!/bin/bash
|
||||
# Test Docker push workflow locally using act
|
||||
# Usage: scripts/test-docker-push.sh
|
||||
|
||||
set -e
|
||||
|
||||
echo "🧪 Testing Docker Push Workflow Locally"
|
||||
echo "======================================"
|
||||
echo ""
|
||||
|
||||
# Check requirements
|
||||
if ! command -v act >/dev/null 2>&1; then
|
||||
echo "❌ act not found. Please install act first."
|
||||
echo " brew install act"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if ! command -v docker >/dev/null 2>&1; then
|
||||
echo "❌ Docker not found. Please install Docker first."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "✅ Requirements met"
|
||||
echo ""
|
||||
|
||||
# Test the Docker push workflow
|
||||
echo "1. Testing Docker push workflow with act..."
|
||||
echo " This may take a few minutes..."
|
||||
echo ""
|
||||
|
||||
# Run act with the docker-push workflow
|
||||
act \
|
||||
-W .gitea/workflows/docker-push.yaml \
|
||||
--job docker-push \
|
||||
--secret GITEA_TOKEN=dummy_token \
|
||||
--secret PACKAGES_TOKEN=dummy_token \
|
||||
--env GITEA_INTERNAL=https://gitea.arcodange.lab/ \
|
||||
--env GITEA_EXTERNAL=https://gitea.arcodange.fr/ \
|
||||
--env GITEA_ORG=arcodange \
|
||||
--env GITEA_REPO=dance-lessons-coach \
|
||||
--env CI_REGISTRY=gitea.arcodange.lab
|
||||
|
||||
echo ""
|
||||
echo "✅ Local testing complete!"
|
||||
echo ""
|
||||
echo "💡 If the test failed, check:"
|
||||
echo " - Dockerfile.prod.template syntax"
|
||||
echo " - Dependency hash calculation"
|
||||
echo " - Docker build context"
|
||||
echo " - Go module dependencies"
|
||||
echo ""
|
||||
echo "💡 To test specific scenarios:"
|
||||
echo " act -W .gitea/workflows/docker-push.yaml --list"
|
||||
echo " act -W .gitea/workflows/docker-push.yaml --job docker-push --dryrun"
|
||||
Reference in New Issue
Block a user