diff --git a/.woodpecker.yml b/.woodpecker.yml new file mode 100644 index 0000000..839ee1e --- /dev/null +++ b/.woodpecker.yml @@ -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