From 28ab410078f2f820a61fc043ca941bcb78b13824 Mon Sep 17 00:00:00 2001 From: Aaron Riedel Date: Wed, 11 Oct 2023 22:57:50 +0200 Subject: [PATCH] add drone pipeline for kustomize --- .drone.yml | 82 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 82 insertions(+) create mode 100644 .drone.yml diff --git a/.drone.yml b/.drone.yml new file mode 100644 index 0000000..c153f6c --- /dev/null +++ b/.drone.yml @@ -0,0 +1,82 @@ +kind: pipeline +name: deploy +steps: +- name: kustomize build dashboard (prod + staging) + image: aaronriedel/kustomize-ci + commands: + - cd /deployment-repo + - git clone https://git.ar21.de/yolokube/core-deployments.git . + - cd /deployment-repo/dashboard/overlays/prod + - kustomize build -o /deployment-repo/dashboard/prod/dashboard.yaml + - cd /deployment-repo/dashboard/overlays/staging + - kustomize build -o /deployment-repo/dashboard/staging/dashboard.yaml + volumes: + - name: deployment-repo + path: /deployment-repo + when: + branch: + - main + event: + - push +- name: kustomize build dashboard (staging) + image: aaronriedel/kustomize-ci + commands: + - cd /deployment-repo + - git clone https://git.ar21.de/yolokube/core-deployments.git . + - cd /deployment-repo/dashboard/overlays/staging + - kustomize build -o /deployment-repo/dashboard/staging/dashboard.yaml + volumes: + - name: deployment-repo + path: /deployment-repo + when: + branch: + exclude: + - main + event: + - push +- name: kustomize push dashboard changes (prod + staging) + image: appleboy/drone-git-push + settings: + branch: main + remote: ssh://git@git.ar21.de:2222/yolokube/core-deployments.git + path: /deployment-repo + force: false + commit: true + commit_message: "KUSTOMIZE BUILD: rebuild dashboard deployment with kustomize ${DRONE_BUILD_NUMBER} (done automagically via Drone pipeline)" + ssh_key: + from_secret: GITEA_SSH_KEY + volumes: + - name: deployment-repo + path: /deployment-repo + when: + branch: + - main + event: + - push +- name: kustomize push dashboard changes (staging) + image: appleboy/drone-git-push + settings: + branch: main + remote: ssh://git@git.ar21.de:2222/yolokube/core-deployments.git + path: /deployment-repo + force: false + commit: true + commit_message: "KUSTOMIZE BUILD STAGING: rebuild dashboard deployment with kustomize ${DRONE_BUILD_NUMBER} (done automagically via Drone pipeline)" + ssh_key: + from_secret: GITEA_SSH_KEY + volumes: + - name: deployment-repo + path: /deployment-repo + when: + branch: + exclude: + - main + event: + - push +volumes: +- name: deployment-repo + temp: {} +when: + event: + exclude: + - pull_request \ No newline at end of file