2022-04-24 17:49:33 +00:00
|
|
|
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
|
2022-04-24 17:55:38 +00:00
|
|
|
TOKEN_WEATHER:
|
|
|
|
from_secret: bot_token_weather
|
2022-04-24 17:49:33 +00:00
|
|
|
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
|