all-tg-bot/.drone.yml

54 lines
1.0 KiB
YAML
Raw Normal View History

2022-04-02 08:17:44 +00:00
kind: pipeline
type: docker
name: default
steps:
- name: build
image: golang
commands:
- go build -o butler_tg_bot main.go
2022-04-03 10:08:13 +00:00
- name: scp
image: appleboy/drone-scp
settings:
host:
2023-03-11 07:07:42 +00:00
from_secret: server_ip
2022-04-03 10:08:13 +00:00
username:
2023-03-11 07:07:42 +00:00
from_secret: ssh_user
key:
from_secret: ssh_key
2022-04-03 10:08:13 +00:00
port:
from_secret: ssh_port
2023-03-11 07:07:42 +00:00
target:
- deploys/butler_tg_bot
2022-04-03 10:08:13 +00:00
source:
- butler_tg_bot
rm: true
- name: deploy
image: appleboy/drone-ssh
environment:
TOKEN:
from_secret: bot_token
2022-04-03 11:33:09 +00:00
PASSWORD:
from_secret: ssh_pass
2022-04-03 10:08:13 +00:00
settings:
host:
2023-03-11 07:07:42 +00:00
from_secret: server_ip
2022-04-03 10:08:13 +00:00
username:
2023-03-11 07:07:42 +00:00
from_secret: ssh_user
key:
from_secret: ssh_key
2022-04-03 10:08:13 +00:00
port:
from_secret: ssh_port
2022-04-03 11:33:09 +00:00
envs: [ TOKEN,PASSWORD ]
2022-04-03 10:32:41 +00:00
command_timeout: 10s
2022-04-03 10:08:13 +00:00
script:
2023-03-11 07:07:42 +00:00
- cd deploys/butler_tg_bot
2022-04-03 11:06:45 +00:00
- echo $${TOKEN} > token.txt
2023-03-11 07:07:42 +00:00
- echo $${PASSWORD} | sudo -S systemctl restart butler
2022-04-03 10:08:13 +00:00
2022-04-02 08:17:44 +00:00
trigger:
event:
2022-04-03 11:25:21 +00:00
- push