ci: adiciona pipeline woodpecker com build kaniko e gitops
Some checks failed
ci/woodpecker/push/woodpecker Pipeline failed

This commit is contained in:
Winícius 2026-11-26 15:08:10 -03:00
parent a9fad1f722
commit 394d2c2730

31
.woodpecker.yml Normal file
View File

@ -0,0 +1,31 @@
when:
- event: [push, manual]
branch: [main, master]
steps:
- name: build-and-push
image: gcr.io/kaniko-project/executor:debug
commands:
- /kaniko/executor
--context="."
--dockerfile="Dockerfile"
--destination="registry.registry.svc.cluster.local:5000/maestri-remote-relay:${CI_COMMIT_SHA:0:7}"
--insecure
- name: update-gitops
image: alpine/git:latest
environment:
GIT_PUSH_TOKEN:
from_secret: git_push_token
commands:
- |
set -eu
SHORT_SHA=$(echo "$CI_COMMIT_SHA" | cut -c1-7)
git clone "http://winicomw:${GIT_PUSH_TOKEN}@gitea.gitea.svc.cluster.local:3000/winicomw/SREOracleServer.git" /tmp/sre
cd /tmp/sre
git config user.name "Woodpecker CI"
git config user.email "ci@winicomw.ddnsfree.com"
sed -i "s|image: .*maestri-remote-relay:.*|image: registry.registry.svc.cluster.local:5000/maestri-remote-relay:${SHORT_SHA}|g" k8s/maestri-remote.yaml
git add k8s/maestri-remote.yaml
git diff --cached --quiet || git commit -m "chore(gitops): atualiza maestri-remote-relay para ${SHORT_SHA}"
git push