weapp/.drone.yml

58 lines
1.0 KiB
YAML
Raw Permalink Normal View History

2021-12-25 02:06:49 +08:00
kind: pipeline
type: docker
2021-12-26 01:58:57 +08:00
name: apiserver
2021-12-25 02:06:49 +08:00
platform:
os: linux
arch: amd64
steps:
- name: build
2021-12-25 02:52:10 +08:00
image: golang:1.17-alpine
2021-12-25 02:06:49 +08:00
pull: if-not-exists
environment:
CGO_ENABLED: 0
GOOS: linux
GOARCH: amd64
commands:
- env
2021-12-25 02:31:10 +08:00
- go build -tags timetzdata -v -o app cmd/apiserver/main.go
2021-12-25 02:06:49 +08:00
- name: publish
2021-12-25 02:42:31 +08:00
image: plugins/docker
2021-12-25 02:06:49 +08:00
pull: if-not-exists
settings:
2021-12-25 02:55:53 +08:00
repo: esinio/kimbon
2021-12-25 02:06:49 +08:00
username:
from_secret: docker_username
password:
from_secret: docker_password
2021-12-25 02:55:53 +08:00
tags:
2021-12-26 01:58:57 +08:00
- apiserver-v0.1
---
kind: pipeline
type: docker
name: deploy
2021-12-25 02:06:49 +08:00
2021-12-26 02:03:49 +08:00
steps:
- name: production
2021-12-25 02:06:49 +08:00
image: docker/compose:1.29.2
pull: if-not-exists
volumes:
- name: docker_sock
path: /var/run/docker.sock
commands:
- docker-compose pull
2021-12-25 02:06:49 +08:00
- 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