From 8b2d05b0f79a636776574247d41c71131c1f6176 Mon Sep 17 00:00:00 2001 From: Robert Marshall Date: Sat, 11 Apr 2020 13:04:31 +0100 Subject: [PATCH] Drone CI config --- .drone.yml | 48 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 .drone.yml diff --git a/.drone.yml b/.drone.yml new file mode 100644 index 0000000..6a59287 --- /dev/null +++ b/.drone.yml @@ -0,0 +1,48 @@ +kind: pipeline +name: default + +clone: + skip_verify: true + +volumes: +- name: output + host: + path: /var/www/Api.Blog + +steps: +- name: build and publish + image: mcr.microsoft.com/dotnet/core/sdk:3.1 + volumes: + - name: output + path: /output + environment: + ConnectionString: + from_secret: ConnectionString + commands: + - chmod +x ./build.sh + - ./build.sh + - sed -i "s//$ConnectionString/g" output/appsettings.json + - cp Infrastructure/website.service output/ + - cp -r ./output/* /output +- name: restart service + privileged: true + image: appleboy/drone-ssh + settings: + host: 192.168.1.3 + username: + from_secret: ssh_user + password: + from_secret: ssh_password + script: + - systemctl daemon-reload + - service api.blog restart +- name: notify + image: drillster/drone-email + settings: + host: 192.168.1.3 + skip_verify: true + from: build@robware.uk + when: + status: + - changed + - failure \ No newline at end of file