diff --git a/.drone.yml b/.drone.yml index ccc7fc9..b5f5165 100644 --- a/.drone.yml +++ b/.drone.yml @@ -38,23 +38,49 @@ steps: - 'latest' -# deploy to kubernetes -- image: 'docker.io/bitnami/kubectl' - name: 'deploy' - pull: 'always' - when: - branch: - - 'main' - event: - - 'push' +# kubernetes deployment +--- +kind: 'pipeline' +name: 'deployment' +type: 'kubernetes' - settings: - mtu: '1440' +depends_on: + - 'build' - environment: - KUBE_CONFIG: - from_secret: 'drone_kube_config_kaas' +# disable clone +clone: + disable: true - commands: - - 'echo "$KUBE_CONFIG" > $HOME/.kube/config' - - 'kubectl -n roundcube rollout restart statefulsets roundcube-app' +# deployment step +steps: + + # kubernetes deployment + - name: 'kubernetes deployment' + image: 'docker.io/appleboy/drone-ssh:1' + when: + branch: + - 'master' + event: + - 'push' + + settings: + + # bastion + proxy_host: 'siempie.com' + proxy_port: '22' + proxy_user: + from_secret: 'drone_user' + proxy_key: + from_secret: 'drone_ssh_key' + + # k9s + host: 'k9s.siempie.internal' + port: '22' + user: + from_secret: 'drone_user' + key: + from_secret: 'drone_ssh_key' + script: + + # kubernetes deployment + - 'kubectl -n roundcube rollout restart statefulsets roundcube-app'