change .drone.yml to new format (#33)
This commit is contained in:
parent
c9d054ae4f
commit
07a623ff83
297
.drone.yml
297
.drone.yml
|
@ -1,137 +1,194 @@
|
||||||
|
---
|
||||||
|
kind: pipeline
|
||||||
|
name: default
|
||||||
|
|
||||||
|
platform:
|
||||||
|
os: linux
|
||||||
|
arch: amd64
|
||||||
|
|
||||||
workspace:
|
workspace:
|
||||||
base: /go
|
base: /go
|
||||||
path: src/code.gitea.io/tea
|
path: src/code.gitea.io/tea
|
||||||
|
|
||||||
clone:
|
steps:
|
||||||
git:
|
- name: build
|
||||||
image: plugins/git:next
|
pull: always
|
||||||
depth: 50
|
image: golang:1.12
|
||||||
tags: true
|
environment:
|
||||||
|
|
||||||
pipeline:
|
|
||||||
build:
|
|
||||||
image: golang:1.12
|
|
||||||
pull: true
|
|
||||||
environment:
|
|
||||||
GOPROXY: https://goproxy.cn
|
GOPROXY: https://goproxy.cn
|
||||||
commands:
|
commands:
|
||||||
- make clean
|
- make clean
|
||||||
- make vet
|
- make vet
|
||||||
- make lint
|
- make lint
|
||||||
- make fmt-check
|
- make fmt-check
|
||||||
- make misspell-check
|
- make misspell-check
|
||||||
- make test-vendor
|
- make test-vendor
|
||||||
- make build
|
- make build
|
||||||
when:
|
when:
|
||||||
event: [ push, tag, pull_request ]
|
event:
|
||||||
|
- push
|
||||||
|
- tag
|
||||||
|
- pull_request
|
||||||
|
|
||||||
unit-test:
|
- name: unit-test
|
||||||
image: golang:1.12
|
pull: always
|
||||||
pull: true
|
image: golang:1.12
|
||||||
|
commands:
|
||||||
|
- make unit-test-coverage
|
||||||
|
settings:
|
||||||
group: test
|
group: test
|
||||||
commands:
|
when:
|
||||||
- make unit-test-coverage
|
branch:
|
||||||
when:
|
- master
|
||||||
event: [ push, pull_request ]
|
event:
|
||||||
branch: [ master ]
|
- push
|
||||||
|
- pull_request
|
||||||
|
|
||||||
release-test:
|
- name: release-test
|
||||||
image: golang:1.12
|
pull: always
|
||||||
pull: true
|
image: golang:1.12
|
||||||
|
commands:
|
||||||
|
- make test
|
||||||
|
settings:
|
||||||
group: test
|
group: test
|
||||||
commands:
|
when:
|
||||||
- make test
|
branch:
|
||||||
when:
|
- "release/*"
|
||||||
event: [ push, pull_request ]
|
event:
|
||||||
branch: [ release/* ]
|
- push
|
||||||
|
- pull_request
|
||||||
|
|
||||||
tag-test:
|
- name: tag-test
|
||||||
image: golang:1.12
|
pull: always
|
||||||
pull: true
|
image: golang:1.12
|
||||||
|
commands:
|
||||||
|
- make test
|
||||||
|
settings:
|
||||||
group: test
|
group: test
|
||||||
commands:
|
when:
|
||||||
- make test
|
event:
|
||||||
when:
|
- tag
|
||||||
event: [ tag ]
|
|
||||||
|
|
||||||
static:
|
- name: static
|
||||||
image: techknowlogick/xgo:latest
|
pull: always
|
||||||
pull: true
|
image: techknowlogick/xgo:latest
|
||||||
commands:
|
commands:
|
||||||
- export PATH=$PATH:$GOPATH/bin
|
- export PATH=$PATH:$GOPATH/bin
|
||||||
- make release
|
- make release
|
||||||
when:
|
when:
|
||||||
event: [ push, tag ]
|
event:
|
||||||
|
- push
|
||||||
|
- tag
|
||||||
|
|
||||||
gpg-sign:
|
- name: gpg-sign
|
||||||
image: plugins/gpgsign:1
|
pull: always
|
||||||
pull: true
|
image: plugins/gpgsign:1
|
||||||
secrets: [ gpgsign_key, gpgsign_passphrase ]
|
settings:
|
||||||
detach_sign: true
|
detach_sign: true
|
||||||
files:
|
|
||||||
- dist/release/*
|
|
||||||
excludes:
|
excludes:
|
||||||
- dist/release/*.sha256
|
- "dist/release/*.sha256"
|
||||||
when:
|
|
||||||
event: [ push, tag ]
|
|
||||||
|
|
||||||
tag-release:
|
|
||||||
image: plugins/s3:1
|
|
||||||
pull: true
|
|
||||||
secrets: [ aws_access_key_id, aws_secret_access_key ]
|
|
||||||
bucket: releases
|
|
||||||
acl: public-read
|
|
||||||
endpoint: https://storage.gitea.io
|
|
||||||
path_style: true
|
|
||||||
strip_prefix: dist/release/
|
|
||||||
source: dist/release/*
|
|
||||||
target: /tea/${DRONE_TAG##v}
|
|
||||||
when:
|
|
||||||
event: [ tag ]
|
|
||||||
|
|
||||||
release-branch-release:
|
|
||||||
image: plugins/s3:1
|
|
||||||
pull: true
|
|
||||||
secrets: [ aws_access_key_id, aws_secret_access_key ]
|
|
||||||
bucket: releases
|
|
||||||
acl: public-read
|
|
||||||
endpoint: https://storage.gitea.io
|
|
||||||
path_style: true
|
|
||||||
strip_prefix: dist/release/
|
|
||||||
source: dist/release/*
|
|
||||||
target: /tea/${DRONE_BRANCH##release/v}
|
|
||||||
when:
|
|
||||||
event: [ push ]
|
|
||||||
branch: [ release/* ]
|
|
||||||
|
|
||||||
release:
|
|
||||||
image: plugins/s3:1
|
|
||||||
pull: true
|
|
||||||
secrets: [ aws_access_key_id, aws_secret_access_key ]
|
|
||||||
bucket: releases
|
|
||||||
acl: public-read
|
|
||||||
endpoint: https://storage.gitea.io
|
|
||||||
path_style: true
|
|
||||||
strip_prefix: dist/release/
|
|
||||||
source: dist/release/*
|
|
||||||
target: /tea/master
|
|
||||||
when:
|
|
||||||
event: [ push ]
|
|
||||||
branch: [ master ]
|
|
||||||
|
|
||||||
github:
|
|
||||||
image: plugins/github-release:1
|
|
||||||
pull: true
|
|
||||||
secrets: [ github_token ]
|
|
||||||
files:
|
files:
|
||||||
- dist/release/*
|
- "dist/release/*"
|
||||||
when:
|
environment:
|
||||||
event: [ tag ]
|
GPGSIGN_KEY:
|
||||||
|
from_secret: gpgsign_key
|
||||||
|
GPGSIGN_PASSPHRASE:
|
||||||
|
from_secret: gpgsign_passphrase
|
||||||
|
when:
|
||||||
|
event:
|
||||||
|
- push
|
||||||
|
- tag
|
||||||
|
|
||||||
discord:
|
- name: tag-release
|
||||||
image: appleboy/drone-discord:1.0.0
|
pull: always
|
||||||
pull: true
|
image: plugins/s3:1
|
||||||
secrets: [ discord_webhook_id, discord_webhook_token ]
|
settings:
|
||||||
when:
|
acl: public-read
|
||||||
event: [ push, tag, pull_request ]
|
bucket: releases
|
||||||
status: [ changed, failure ]
|
endpoint: https://storage.gitea.io
|
||||||
|
path_style: true
|
||||||
|
source: "dist/release/*"
|
||||||
|
strip_prefix: dist/release/
|
||||||
|
target: "/tea/${DRONE_TAG##v}"
|
||||||
|
environment:
|
||||||
|
AWS_ACCESS_KEY_ID:
|
||||||
|
from_secret: aws_access_key_id
|
||||||
|
AWS_SECRET_ACCESS_KEY:
|
||||||
|
from_secret: aws_secret_access_key
|
||||||
|
when:
|
||||||
|
event:
|
||||||
|
- tag
|
||||||
|
|
||||||
|
- name: release-branch-release
|
||||||
|
pull: always
|
||||||
|
image: plugins/s3:1
|
||||||
|
settings:
|
||||||
|
acl: public-read
|
||||||
|
bucket: releases
|
||||||
|
endpoint: https://storage.gitea.io
|
||||||
|
path_style: true
|
||||||
|
source: "dist/release/*"
|
||||||
|
strip_prefix: dist/release/
|
||||||
|
target: "/tea/${DRONE_BRANCH##release/v}"
|
||||||
|
environment:
|
||||||
|
AWS_ACCESS_KEY_ID:
|
||||||
|
from_secret: aws_access_key_id
|
||||||
|
AWS_SECRET_ACCESS_KEY:
|
||||||
|
from_secret: aws_secret_access_key
|
||||||
|
when:
|
||||||
|
branch:
|
||||||
|
- "release/*"
|
||||||
|
event:
|
||||||
|
- push
|
||||||
|
|
||||||
|
- name: release
|
||||||
|
pull: always
|
||||||
|
image: plugins/s3:1
|
||||||
|
settings:
|
||||||
|
acl: public-read
|
||||||
|
bucket: releases
|
||||||
|
endpoint: https://storage.gitea.io
|
||||||
|
path_style: true
|
||||||
|
source: "dist/release/*"
|
||||||
|
strip_prefix: dist/release/
|
||||||
|
target: /tea/master
|
||||||
|
environment:
|
||||||
|
AWS_ACCESS_KEY_ID:
|
||||||
|
from_secret: aws_access_key_id
|
||||||
|
AWS_SECRET_ACCESS_KEY:
|
||||||
|
from_secret: aws_secret_access_key
|
||||||
|
when:
|
||||||
|
branch:
|
||||||
|
- master
|
||||||
|
event:
|
||||||
|
- push
|
||||||
|
|
||||||
|
- name: github
|
||||||
|
pull: always
|
||||||
|
image: plugins/gitea-releases:1
|
||||||
|
settings:
|
||||||
|
files:
|
||||||
|
- "dist/release/*"
|
||||||
|
environment:
|
||||||
|
GITHUB_TOKEN:
|
||||||
|
from_secret: github_token
|
||||||
|
when:
|
||||||
|
event:
|
||||||
|
- tag
|
||||||
|
|
||||||
|
- name: discord
|
||||||
|
pull: always
|
||||||
|
image: appleboy/drone-discord:1.0.0
|
||||||
|
environment:
|
||||||
|
DISCORD_WEBHOOK_ID:
|
||||||
|
from_secret: discord_webhook_id
|
||||||
|
DISCORD_WEBHOOK_TOKEN:
|
||||||
|
from_secret: discord_webhook_token
|
||||||
|
when:
|
||||||
|
event:
|
||||||
|
- push
|
||||||
|
- tag
|
||||||
|
- pull_request
|
||||||
|
status:
|
||||||
|
- changed
|
||||||
|
- failure
|
Loading…
Reference in New Issue