From a3d4bbf5deabd8e1d34ce9e965cd73deeb0c37d5 Mon Sep 17 00:00:00 2001 From: lab Date: Sat, 25 Dec 2021 02:06:49 +0800 Subject: [PATCH] feat: add drone pipelines --- .drone.yml | 48 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 .drone.yml diff --git a/.drone.yml b/.drone.yml new file mode 100644 index 0000000..608f945 --- /dev/null +++ b/.drone.yml @@ -0,0 +1,48 @@ +kind: pipeline +type: docker +name: default + +platform: + os: linux + arch: amd64 + +steps: + - name: build + image: glang:1.17-alpine + pull: if-not-exists + environment: + CGO_ENABLED: 0 + GOOS: linux + GOARCH: amd64 + commands: + - env + - go build -tags timetzdata -race -v -o app cmd/apiserver/main.go + + - name: publish + images: plugins/docker + pull: if-not-exists + settings: + repo: esinio/kimbon:apiserver + username: + from_secret: docker_username + password: + from_secret: docker_password + + - name: deploy + image: docker/compose:1.29.2 + pull: if-not-exists + volumes: + - name: docker_sock + path: /var/run/docker.sock + commands: + - docker-compose up --detach --verbose --force-recreate --file ./docker-compose.yml + when: + event: + - promote + target: + - production + +volumes: + - name: docker-sock + host: + path: /var/run/docker.sock