From 52246f34d07203eb55a51da3fea34524d18dd157 Mon Sep 17 00:00:00 2001 From: Aaron Riedel Date: Tue, 14 Feb 2023 00:39:45 +0100 Subject: [PATCH] add cd to the pipeline --- .drone.yml | 38 +++++++++++++++++++++++++++++++++++++- 1 file changed, 37 insertions(+), 1 deletion(-) diff --git a/.drone.yml b/.drone.yml index 45f9457..f3c6df4 100644 --- a/.drone.yml +++ b/.drone.yml @@ -11,4 +11,40 @@ steps: repo: aaronriedel/egress-test tags: - latest - - ${DRONE_COMMIT} \ No newline at end of file + - ${DRONE_COMMIT_SHA:0:8} +- name: get deployment repo + image: debian + commands: + - apt-get update -qq + - apt-get install -y -qq git + - cd /deployment-repo + - git clone https://git.ar21.de/aaron/egress-test-deployment.git . + volumes: + - name: deployment-repo + path: /deployment-repo +- name: update image in deployment repo + image: nekottyo/kustomize-kubeval + commands: + - cd /deployment-repo + - kustomize edit set image aaronriedel/egress-test=aaronriedel/egress-test:${DRONE_COMMIT_SHA:0:8} + - kustomize build -o /deployment-repo/ressources/deployment.yaml + volumes: + - name: deployment-repo + path: /deployment-repo +- name: push new tag to deployment-repo + image: appleboy/drone-git-push + settings: + branch: main + remote: ssh://git@git.ar21.de:2222/aaron/egress-test-deployment.git + path: /deployment-repo + force: false + commit: true + commit_message: "update image tag to ${DRONE_COMMIT_SHA:0:8}" + ssh_key: + from_secret: GITEA_SSH_KEY + volumes: + - name: deployment-repo + path: /deployment-repo +volumes: +- name: deployment-repo + temp: {} \ No newline at end of file