Fix provision-secrets: check for yaml changes before scp to avoid failure on non-stack commits
ci/woodpecker/push/woodpecker Pipeline was successful
ci/woodpecker/push/woodpecker Pipeline was successful
This commit is contained in:
+3
-1
@@ -24,10 +24,12 @@ steps:
|
|||||||
- echo "$SSH_KEY" | base64 -d > ~/.ssh/id_rsa
|
- echo "$SSH_KEY" | base64 -d > ~/.ssh/id_rsa
|
||||||
- chmod 600 ~/.ssh/id_rsa
|
- chmod 600 ~/.ssh/id_rsa
|
||||||
- ssh-keyscan -H 192.168.4.32 >> ~/.ssh/known_hosts 2>/dev/null
|
- ssh-keyscan -H 192.168.4.32 >> ~/.ssh/known_hosts 2>/dev/null
|
||||||
|
- |
|
||||||
|
YAML_FILES=$(echo "${CI_COMMIT_CHANGED_FILES}" | tr ',' '\n' | grep '\.yaml$' || true)
|
||||||
|
[ -z "$YAML_FILES" ] && echo "No stack yaml files changed, skipping" && exit 0
|
||||||
- scp -o StrictHostKeyChecking=no deploy/create-secrets.sh root@192.168.4.32:/tmp/cs.sh
|
- scp -o StrictHostKeyChecking=no deploy/create-secrets.sh root@192.168.4.32:/tmp/cs.sh
|
||||||
- |
|
- |
|
||||||
YAML_FILES=$(echo "${CI_COMMIT_CHANGED_FILES}" | tr ',' '\n' | grep '\.yaml$' || true)
|
YAML_FILES=$(echo "${CI_COMMIT_CHANGED_FILES}" | tr ',' '\n' | grep '\.yaml$' || true)
|
||||||
[ -z "$YAML_FILES" ] && echo "No stacks changed" && exit 0
|
|
||||||
for f in $YAML_FILES; do
|
for f in $YAML_FILES; do
|
||||||
STACK=$(basename "$f" .yaml)
|
STACK=$(basename "$f" .yaml)
|
||||||
echo "Provisioning: $STACK"
|
echo "Provisioning: $STACK"
|
||||||
|
|||||||
Reference in New Issue
Block a user