This commit is contained in:
@ -36,25 +36,11 @@ steps:
|
|||||||
from_secret: gitea-known-host
|
from_secret: gitea-known-host
|
||||||
commands:
|
commands:
|
||||||
- mkdir -p ~/.ssh
|
- mkdir -p ~/.ssh
|
||||||
- echo "${MY_VAR3}" >> ~/.ssh/known_hosts
|
- echo "$${MY_VAR3}" >> ~/.ssh/known_hosts
|
||||||
- chmod 644 ~/.ssh/known_hosts
|
- chmod 644 ~/.ssh/known_hosts
|
||||||
- echo "${MY_VAR2}" > ~/.ssh/id_rsa
|
- echo "$${MY_VAR2}" > ~/.ssh/id_rsa
|
||||||
- chmod 600 ~/.ssh/id_rsa
|
- chmod 600 ~/.ssh/id_rsa
|
||||||
- git config --global user.name "woodpecker[bot]"
|
- git config --global user.name "woodpecker[bot]"
|
||||||
- git config --global user.email "woodpecker@marcin00.pl"
|
- git config --global user.email "woodpecker@marcin00.pl"
|
||||||
- git clone "${MY_VAR1}" --branch woodpecker-deploy
|
- git clone "${MY_VAR1}" --branch woodpecker-deploy
|
||||||
- cd user-microservice-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
|
|
||||||
|
Reference in New Issue
Block a user