From 3fb5c217e43998d790b29b818d75fdb315e9eda7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adam=20=C5=A0trauch?= Date: Tue, 26 Oct 2021 23:08:07 +0200 Subject: [PATCH] Sandbox deploy --- .drone.yml | 34 +++++++++++++++++++++++++++++++++- 1 file changed, 33 insertions(+), 1 deletion(-) diff --git a/.drone.yml b/.drone.yml index 5dceef2..87c587a 100644 --- a/.drone.yml +++ b/.drone.yml @@ -4,7 +4,7 @@ name: testing steps: - name: test - image: golang + image: golang:1.17-buster environment: SNAPSHOTS_S3_ENDPOINT: minio:9000 TEST_S3_ENDPOINT: minio:9000 @@ -23,3 +23,35 @@ services: - /data - --console-address - :9001 + +--- + +kind: pipeline +type: docker +name: Sandbox deploy + +steps: +- name: build + image: golang:1.17-buster + commands: + - go mod tidy + - make build +- name: deploy + image: debian:buster + environment: + NODE: node-x.rosti.cz + SSH_KEY: + from_secret: ssh_key + commands: + - apt update && apt install -y ssh + - mkdir ~/.ssh && echo $SSH_KEY > ~/.ssh/id_key && chmod 600 ~/.ssh/id_key + - scp node-api root@$NODES:/usr/local/bin/node-api_ + - ssh root@$NODES mv /usr/local/bin/node-api_ /usr/local/bin/node-api + - ssh root@$NODES systemctl restart node-api + +trigger: + branch: + - main + event: + - push + - custom