Files
openbb-invest-api/.drone.yml
Yaojia Wang d4e06c71b7 ci: auto-update image tag in kustomization for ArgoCD sync
Add Drone CI step to update kustomization.yaml newTag with commit SHA
after image build, enabling ArgoCD to detect manifest changes and
auto-deploy new images.
2026-03-18 23:32:17 +01:00

41 lines
1.1 KiB
YAML

kind: pipeline
type: kubernetes
name: build-and-push
trigger:
branch:
- main
- develop
event:
- push
- custom
steps:
- name: build-and-push
image: gcr.io/kaniko-project/executor:debug
commands:
- >
/kaniko/executor
--context=/drone/src
--dockerfile=Dockerfile
--destination=192.168.68.11:30500/invest-api:${DRONE_COMMIT_SHA:0:8}
--destination=192.168.68.11:30500/invest-api:latest
--insecure
--skip-tls-verify
- name: update-manifests
image: alpine/git:latest
environment:
GITEA_TOKEN:
from_secret: gitea_token
commands:
- cd /drone/src
- TAG=$(echo $DRONE_COMMIT_SHA | cut -c1-8)
- sed -i "s/newTag:.*/newTag: $TAG/" k8s/base/kustomization.yaml
- git config user.email "drone@colacoder.com"
- git config user.name "Drone CI"
- git add k8s/base/kustomization.yaml
- "git commit -m \"chore: update image tag to $TAG [skip ci]\""
- git remote set-url origin https://kai:$GITEA_TOKEN@git.colacoder.com/kai/openbb-invest-api.git
- git push origin main