fix(woodpecker): use exit code 78 to skip builds instead of evaluate
This commit is contained in:
parent
a3622de8e9
commit
2370f62eac
1 changed files with 17 additions and 34 deletions
|
|
@ -21,18 +21,15 @@ steps:
|
|||
echo "✅ Admin panel code changed - will build"
|
||||
fi
|
||||
|
||||
# Create marker file
|
||||
# Exit with code 78 to skip subsequent steps if no changes
|
||||
if [ "$RELEVANT_CHANGED" = "true" ]; then
|
||||
echo "SHOULD_BUILD=true" > .build-marker
|
||||
echo "🚀 Will build admin panel"
|
||||
exit 0
|
||||
else
|
||||
echo "SHOULD_BUILD=false" > .build-marker
|
||||
echo "⏭️ Skipping admin panel - no relevant changes"
|
||||
exit 78
|
||||
fi
|
||||
|
||||
# Export for other steps
|
||||
cat .build-marker >> ${CI_ENV}
|
||||
|
||||
- name: build-and-push
|
||||
image: woodpeckerci/plugin-docker-buildx:5.0.0
|
||||
settings:
|
||||
|
|
@ -48,8 +45,6 @@ steps:
|
|||
password:
|
||||
from_secret: GHCR_TOKEN
|
||||
platforms: linux/amd64
|
||||
when:
|
||||
- evaluate: 'env.SHOULD_BUILD == "true"'
|
||||
|
||||
- name: deploy
|
||||
image: bitnami/kubectl:latest
|
||||
|
|
@ -61,12 +56,6 @@ steps:
|
|||
#!/bin/bash
|
||||
set -e
|
||||
|
||||
# Check if we should deploy
|
||||
if [ "${SHOULD_BUILD}" != "true" ]; then
|
||||
echo "⏭️ Skipping deployment - no changes"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
# Setup kubeconfig
|
||||
mkdir -p ~/.kube
|
||||
echo "$KUBE_CONFIG" | base64 -d > ~/.kube/config
|
||||
|
|
@ -88,21 +77,15 @@ steps:
|
|||
|
||||
# Show deployment status
|
||||
kubectl get deployment/${DEPLOYMENT_NAME} -n ${NAMESPACE}
|
||||
when:
|
||||
- evaluate: 'env.SHOULD_BUILD == "true"'
|
||||
|
||||
- name: notify
|
||||
image: alpine:latest
|
||||
commands:
|
||||
- |
|
||||
if [ "${SHOULD_BUILD}" = "true" ]; then
|
||||
if [ "${CI_PIPELINE_STATUS}" = "success" ]; then
|
||||
echo "✅ Admin panel pipeline completed successfully"
|
||||
else
|
||||
echo "❌ Admin panel pipeline failed"
|
||||
fi
|
||||
else
|
||||
echo "⏭️ Admin panel was skipped (no changes)"
|
||||
fi
|
||||
when:
|
||||
- status: [success, failure]
|
||||
status: [success, failure]
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue