From 023ec4bc03b55953e41b6c744062bf208b0bf2d2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=92=D0=BB=D0=B0=D0=B4=D0=B8=D0=BC=D0=B8=D1=80=20=D0=A4?= =?UTF-8?q?=D0=B5=D0=B4=D0=BE=D1=80=D0=BE=D0=B2?= Date: Mon, 25 Apr 2022 00:49:33 +0700 Subject: [PATCH] add drone --- .drone.yml | 53 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) create mode 100644 .drone.yml diff --git a/.drone.yml b/.drone.yml new file mode 100644 index 0000000..d61e0d2 --- /dev/null +++ b/.drone.yml @@ -0,0 +1,53 @@ +kind: pipeline +type: docker +name: default + +steps: + - name: build + image: golang + commands: + - go build -o verochka_tg_bot main.go + + - name: scp + image: appleboy/drone-scp + settings: + host: + from_secret: ssh_ip + username: + from_secret: ssh_login + password: + from_secret: ssh_pass + port: + from_secret: ssh_port + target: bots/verochka_tg_bot + source: + - verochka_tg_bot + rm: true + + - name: deploy + image: appleboy/drone-ssh + environment: + TOKEN: + from_secret: bot_token + PASSWORD: + from_secret: ssh_pass + settings: + host: + from_secret: ssh_ip + username: + from_secret: ssh_login + password: + from_secret: ssh_pass + port: + from_secret: ssh_port + envs: [ TOKEN,TOKEN_WEATHER,PASSWORD ] + command_timeout: 10s + script: + - cd bots/verochka_tg_bot + - echo $${TOKEN} > token.txt + - echo $${TOKEN_WEATHER} > token.txt + - echo $${PASSWORD} | sudo -S systemctl restart verochka_tg_bot + +trigger: + event: + - push