verochka/.drone.yml

61 lines
1.3 KiB
YAML

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: server_ip
username:
from_secret: ssh_user
key:
from_secret: ssh_key
port:
from_secret: ssh_port
target:
- deploys/bots/verochka_tg_bot
source:
- verochka_tg_bot
- config
rm: true
- name: deploy
image: appleboy/drone-ssh
environment:
TOKEN:
from_secret: bot_token
TOKEN_WEATHER:
from_secret: bot_token_weather
CHAT_ID:
from_secret: bot_chat_id
PASSWORD:
from_secret: ssh_pass
settings:
host:
from_secret: server_ip
username:
from_secret: ssh_user
key:
from_secret: ssh_key
port:
from_secret: ssh_port
envs: [ TOKEN,TOKEN_WEATHER,CHAT_ID,PASSWORD ]
command_timeout: 10s
script:
- cd deploys/bots/verochka_tg_bot
- echo $${TOKEN} > token.txt
- echo $${TOKEN_WEATHER} > token_weather.txt
- echo $${CHAT_ID} > chat_id.txt
- echo $${PASSWORD} | sudo -S systemctl restart verochka
trigger:
event:
- push