From ca4e3dfafb2d7d34321839b3798444da6a46ea5d Mon Sep 17 00:00:00 2001 From: Simon Cornet Date: Fri, 3 May 2024 15:57:54 +0200 Subject: [PATCH] [ci] deploy to kaas cluster --- .drone.yaml | 59 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 59 insertions(+) create mode 100644 .drone.yaml diff --git a/.drone.yaml b/.drone.yaml new file mode 100644 index 0000000..e1136d7 --- /dev/null +++ b/.drone.yaml @@ -0,0 +1,59 @@ +--- +kind: 'pipeline' +name: 'build' +type: 'kubernetes' + +steps: + +# build and publish +- image: 'docker.io/plugins/docker' + name: 'publish' + pull: 'always' + when: + branch: + - 'master' + event: + - 'push' + + settings: + + # registery and repos + registry: 'cr.simoncor.net' + repo: 'cr.simoncor.net/siempie/start-simoncor-net' + mtu: '1440' + + # build stuff + dockerfile: 'Dockerfile.linux.amd64' + daemon_off: 'false' + + # authentication + username: + from_secret: 'docker_username' + password: + from_secret: 'docker_password' + + # tags + tags: + - 'v1.1' + - 'latest' + + +# deploy to kubernetes +- image: 'docker.io/bitnami/kubectl' + name: 'deploy' + pull: 'always' + settings: + mtu: '1440' + when: + branch: + - 'master' + event: + - 'push' + + environment: + KUBE_CONFIG: + from_secret: 'drone_kube_config_kaas' + + commands: + - 'echo "$KUBE_CONFIG" > $HOME/.kube/config' + - 'kubectl -n start-simoncor-net rollout restart deployment start-simoncor-net'