butler/build/ci/.drone.yml

64 lines
1.2 KiB
YAML
Raw Normal View History

2023-08-13 17:34:58 +00:00
kind: pipeline
type: docker
name: default
steps:
2023-08-13 20:10:45 +00:00
- name: test
2023-08-13 17:45:31 +00:00
pull: if-not-exists
2023-08-13 17:39:55 +00:00
image: golang:1.20
2023-08-13 17:34:58 +00:00
commands:
2023-08-13 20:10:45 +00:00
- go test ./...
2023-08-13 17:34:58 +00:00
2023-08-13 20:10:45 +00:00
- name: build
pull: if-not-exists
image: golang:1.20
2023-08-13 17:34:58 +00:00
commands:
2023-08-13 20:10:45 +00:00
- GOOS=linux GOARCH=amd64 go build -o butler cmd/butler/main.go
2023-09-12 16:24:10 +00:00
- touch .env
- echo TELEGRAM_TOKEN=AAAAAAAA >> .env
- name: copy to server
pull: if-not-exists
image: appleboy/drone-scp
settings:
host:
from_secret: ssh_ip
username:
from_secret: ssh_user
key:
from_secret: ssh_key
port:
from_secret: ssh_port
target: /home/crab/deploys/butler_bot
source:
- .env
- build/ci/Dockerfile
- deploy/docker-compose.yml
- migrations
rm: true
# - name: deploy
# pull: if-not-exists
# image: appleboy/drone-ssh
# settings:
# host:
# from_secret: ssh_ip
# username:
# from_secret: ssh_user
# key:
# from_secret: ssh_key
# port:
# from_secret: ssh_port
# script:
2023-08-13 20:10:45 +00:00
# TODO:
# scp bin, Dockerfile, docker-compose
# create .env from secrets
# run migrations
# restart container
2023-08-13 17:34:58 +00:00
trigger:
event:
- push