verochka/.drone.yml

61 lines
1.3 KiB
YAML
Raw 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:
2023-03-08 08:35:35 +00:00
from_secret: server_ip
2022-04-24 17:49:33 +00:00
username:
2023-03-08 08:35:35 +00:00
from_secret: ssh_user
key:
from_secret: ssh_key
2022-04-24 17:49:33 +00:00
port:
from_secret: ssh_port
2022-04-24 18:13:49 +00:00
target:
2023-03-08 08:54:55 +00:00
- deploys/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:
2023-03-08 08:35:35 +00:00
from_secret: server_ip
2022-04-24 17:49:33 +00:00
username:
2023-03-08 08:35:35 +00:00
from_secret: ssh_user
key:
from_secret: ssh_key
2022-04-24 17:49:33 +00:00
port:
from_secret: ssh_port
envs: [ TOKEN,TOKEN_WEATHER,CHAT_ID,PASSWORD ]
2022-04-24 17:49:33 +00:00
command_timeout: 10s
script:
2023-03-08 08:54:55 +00:00
- cd deploys/verochka_tg_bot
2022-04-24 17:49:33 +00:00
- 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
2023-03-08 08:42:22 +00:00
- echo $${PASSWORD} | sudo -S systemctl restart verochka
2022-04-24 17:49:33 +00:00
trigger:
event:
- push