verochka/.drone.yml

61 lines
1.3 KiB
YAML
Raw Permalink Normal View History

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
2022-04-24 18:13:49 +00:00
target:
- bots/verochka_tg_bot
2022-04-24 17:49:33 +00:00
source:
- verochka_tg_bot
2022-04-24 18:15:07 +00:00
- config
2022-04-24 17:49:33 +00:00
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
CHAT_ID:
from_secret: bot_chat_id
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,CHAT_ID,PASSWORD ]
2022-04-24 17:49:33 +00:00
command_timeout: 10s
script:
- cd bots/verochka_tg_bot
- echo $${TOKEN} > token.txt
2022-04-24 18:09:53 +00:00
- echo $${TOKEN_WEATHER} > token_weather.txt
2022-09-04 15:52:33 +00:00
- echo $${CHAT_ID} > chat_id.txt
2022-04-24 17:49:33 +00:00
- echo $${PASSWORD} | sudo -S systemctl restart verochka_tg_bot
trigger:
event:
- push