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="${CI_COMMIT_SHA:0: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