From b2ca8c030b0793436b6bca8c8a6986b92b97342a Mon Sep 17 00:00:00 2001 From: user-penguin Date: Tue, 12 Sep 2023 23:24:10 +0700 Subject: [PATCH] change pipeline --- build/ci/.drone.yml | 36 ++++++++++++++++++++++++++++++++++++ deploy/docker-compose.yml | 9 ++++----- 2 files changed, 40 insertions(+), 5 deletions(-) diff --git a/build/ci/.drone.yml b/build/ci/.drone.yml index 350c7d7..9bff477 100644 --- a/build/ci/.drone.yml +++ b/build/ci/.drone.yml @@ -15,6 +15,42 @@ steps: image: golang:1.20 commands: - GOOS=linux GOARCH=amd64 go build -o butler cmd/butler/main.go + - 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: # TODO: # scp bin, Dockerfile, docker-compose diff --git a/deploy/docker-compose.yml b/deploy/docker-compose.yml index a1d06e8..866c737 100644 --- a/deploy/docker-compose.yml +++ b/deploy/docker-compose.yml @@ -1,10 +1,9 @@ -version: "3.3" +version: "3.8" services: - butler: container_name: butler - build: - context: ../build/ci - dockerfile: Dockerfile + build: . command: /butler + env_file: + - .env