You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

59 lines
1.3 KiB

8 months ago
kind: pipeline
type: docker
name: master
steps:
# Do stuff..
- name: build
image: golang:1.16-alpine3.13
environment:
GOMODCACHE: '/drone/src/mod.pkg'
commands:
- GOPROXY=https://goproxy.cn GOSUMDB=off CGO_ENABLED=1 GOOS=linux GOARCH=amd64 go build -ldflags '-w -s' -o bin/server
- name: docker
image: plugins/docker
settings:
dockerfile: "Dockerfile.drone"
repo: harbor.oa00.com/yunyunwenche/server
registry: harbor.oa00.com
username:
from_secret: docker_username
password:
from_secret: docker_password
tags:
- test
trigger:
branch:
- master
event:
- push
- merge
---
kind: pipeline
type: docker
name: prod
steps:
# Do stuff..
- name: build
image: golang:1.16-alpine3.13
environment:
GOMODCACHE: '/drone/src/mod.pkg'
commands:
- GOPROXY=https://goproxy.cn GOSUMDB=off CGO_ENABLED=1 GOOS=linux GOARCH=amd64 go build -ldflags '-w -s' -o bin/server
- name: docker
image: plugins/docker
settings:
dockerfile: "Dockerfile.drone"
repo: harbor.oa00.com/yunyunwenche/server
registry: harbor.oa00.com
username:
from_secret: docker_username
password:
from_secret: docker_password
tags:
- prod
trigger:
branch:
- prod
event:
- push
- merge