Return to original commands
Some checks failed
ci/woodpecker/push/build Pipeline failed

This commit is contained in:
Marcin-Ramotowski
2025-07-22 18:48:12 +02:00
parent 807bc6ae27
commit cfb2d5ae68

View File

@ -29,7 +29,38 @@ steps:
- name: gitops-commit
image: alpine/git
environment:
MY_VAR: test-value
MY_VAR1: test-value
MY_VAR2:
from_secret: gitea-deploy-key
MY_VAR3:
from_secret: gitea-known-host
commands:
- echo "Value of MY_VAR $MY_VAR"
- env | grep MY_VAR
- mkdir -p ~/.ssh
- echo "${MY_VAR3}" >> ~/.ssh/known_hosts
- chmod 644 ~/.ssh/known_hosts
- echo "${MY_VAR2}" > ~/.ssh/id_rsa
- chmod 600 ~/.ssh/id_rsa
- git config --global user.name "woodpecker[bot]"
- git config --global user.email "woodpecker@marcin00.pl"
- git clone "${MY_VAR1}" --branch woodpecker-deploy
- cd user-microservice-deploy
- |
awk -v commit="$CI_COMMIT_SHA" '
$0 ~ /name:[[:space:]]*api/ { in_api_container = 1; print; next }
in_api_container && $0 ~ /^[[:space:]]*image:[[:space:]]*/ {
sub(/:[^:[:space:]]+$/, ":" commit)
in_api_container = 0
print
next
}
{ print }
' deploy.yaml > deploy.tmp && mv deploy.tmp deploy.yaml
- git add deploy.yaml
- 'git diff-index --quiet HEAD || git commit -m "WOODPECKER: Changed deployed version to $CI_COMMIT_SHA"'
- git push origin woodpecker-deploy