add db migration
continuous-integration/drone/push Build is passing Details

This commit is contained in:
user-penguin 2023-09-13 18:32:55 +07:00
parent bc1bce306c
commit e33cf55a42
1 changed files with 6 additions and 0 deletions

View File

@ -50,6 +50,9 @@ steps:
- name: deploy - name: deploy
pull: if-not-exists pull: if-not-exists
image: appleboy/drone-ssh image: appleboy/drone-ssh
environment:
DB_PASS:
from_secret: DB_PASS
settings: settings:
host: host:
from_secret: SSH_IP from_secret: SSH_IP
@ -59,12 +62,15 @@ steps:
from_secret: SSH_KEY from_secret: SSH_KEY
port: port:
from_secret: SSH_PORT from_secret: SSH_PORT
envs: [ DB_PASS ]
script: script:
- cd /home/crab/deploys/butler_bot - cd /home/crab/deploys/butler_bot
- cp /etc/ssl/certs/ca-certificates.crt . - cp /etc/ssl/certs/ca-certificates.crt .
- mv build/ci/Dockerfile . - mv build/ci/Dockerfile .
- mv deploy/docker-compose.yml . - mv deploy/docker-compose.yml .
- rm -r build deploy - rm -r build deploy
- goose -allow-missing -dir ./migrations postgres "user=crab password=$${DB_PASS} dbname=butler host=localhost port=5432 sslmode=disable" up
- docker-compose up -d --force-recreate
# TODO: # TODO:
# scp bin, Dockerfile, docker-compose # scp bin, Dockerfile, docker-compose