From d7904cd03554d8c3bbca6bd0b0c3927b3bf19c3b Mon Sep 17 00:00:00 2001 From: Simon Cornet Date: Fri, 22 Apr 2022 10:44:10 +0200 Subject: [PATCH] [CI] Added drone.yaml config to simoncor.net site --- .drone.yaml | 78 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 78 insertions(+) create mode 100644 .drone.yaml diff --git a/.drone.yaml b/.drone.yaml new file mode 100644 index 0000000..11ae8bf --- /dev/null +++ b/.drone.yaml @@ -0,0 +1,78 @@ +--- + +# deployment +kind: 'pipeline' +type: 'docker' +name: 'deployment' + +# disable clone +clone: + disable: true + +# deployment steps +steps: + + # ansible deployment + - name: 'ansible deployment' + image: 'appleboy/drone-ssh:1.6.3' + settings: + + # bastion + proxy_host: 'siempie.com' + proxy_port: '22' + proxy_user: + from_secret: 'drone_user' + proxy_key: + from_secret: 'drone_ssh_key' + + # rp01.siempie.local + host: 'rp01.siempie.local' + port: '22' + user: + from_secret: 'drone_user' + key: + from_secret: 'drone_ssh_key' + script: + + # make sure all is clean + - 'sudo /usr/bin/git -C /var/www/simoncor.net/ reset --hard HEAD' + - 'sudo /usr/bin/git -C /var/www/simoncor.net/ clean -fX' + - 'sudo /usr/bin/git -C /var/www/simoncor.net/ clean -fd' + + # fetch latest checkout + - 'sudo /usr/bin/git -C /var/www/simoncor.net/ fetch' + - "sudo /usr/bin/git -C /var/www/simoncor.net/ -c advice.detachedHead=false + checkout '${DRONE_COMMIT_SHA:0:8}'" + + + # ansible deployment + - name: 'ansible deployment' + image: 'appleboy/drone-ssh:1.6.3' + settings: + + # bastion + proxy_host: 'siempie.com' + proxy_port: '22' + proxy_user: + from_secret: 'drone_user' + proxy_key: + from_secret: 'drone_ssh_key' + + # rp02.siempie.local + host: 'rp02.siempie.local' + port: '22' + user: + from_secret: 'drone_user' + key: + from_secret: 'drone_ssh_key' + script: + + # make sure all is clean + - 'sudo /usr/bin/git -C /var/www/simoncor.net/ reset --hard HEAD' + - 'sudo /usr/bin/git -C /var/www/simoncor.net/ clean -fX' + - 'sudo /usr/bin/git -C /var/www/simoncor.net/ clean -fd' + + # fetch latest checkout + - 'sudo /usr/bin/git -C /var/www/simoncor.net/ fetch' + - "sudo /usr/bin/git -C /var/www/simoncor.net/ -c advice.detachedHead=false + checkout '${DRONE_COMMIT_SHA:0:8}'"