feat: upgrade drone to 1.0

This commit is contained in:
Bo-Yi Wu 2019-02-16 23:33:00 +08:00
parent f267e5254a
commit e03659cc70

View File

@ -1,18 +1,29 @@
---
kind: pipeline
name: default
platform:
os: linux
arch: amd64
clone:
disable: true
workspace: workspace:
base: /go/src base: /go/src
path: github.com/appleboy/drone-telegram path: github.com/appleboy/drone-telegram
clone: steps:
git: - name: git
pull: default
image: plugins/git image: plugins/git
settings:
depth: 50 depth: 50
tags: true tags: true
pipeline: - name: test
test: pull: always
image: appleboy/golang-testing:1.10.0 image: golang:1.11
pull: true
secrets: [ telegram_token, telegram_to ]
commands: commands:
- make vet - make vet
- make lint - make lint
@ -20,128 +31,186 @@ pipeline:
- make misspell-check - make misspell-check
- make test - make test
- make coverage - make coverage
environment:
TELEGRAM_TO:
from_secret: telegram_to
TELEGRAM_TOKEN:
from_secret: telegram_token
build_linux_amd64: - name: build_linux_amd64
image: appleboy/golang-testing:1.10.0 pull: always
pull: true image: golang:1.11
group: build
commands: commands:
- make build_linux_amd64 - make build_linux_amd64
settings:
build_linux_i386:
image: appleboy/golang-testing:1.10.0
pull: true
group: build group: build
- name: build_linux_i386
pull: always
image: golang:1.11
commands: commands:
- make build_linux_i386 - make build_linux_i386
settings:
build_linux_arm64:
image: appleboy/golang-testing:1.10.0
pull: true
group: build group: build
- name: build_linux_arm64
pull: always
image: golang:1.11
commands: commands:
- make build_linux_arm64 - make build_linux_arm64
settings:
build_linux_arm:
image: appleboy/golang-testing:1.10.0
pull: true
group: build group: build
- name: build_linux_arm
pull: always
image: golang:1.11
commands: commands:
- make build_linux_arm - make build_linux_arm
settings:
group: build
codecov: - name: codecov
pull: default
image: robertstettner/drone-codecov image: robertstettner/drone-codecov
secrets: [ codecov_token ] settings:
files: files:
- .cover/coverage.txt - .cover/coverage.txt
environment:
CODECOV_TOKEN:
from_secret: codecov_token
when: when:
event: [ push, pull_request ] event:
- push
- pull_request
release: - name: release
image: appleboy/golang-testing:1.10.0 pull: always
pull: true image: golang:1.11
commands: commands:
- make release - make release
when: when:
event: [ tag ] event:
- tag
publish_alpine: - name: publish_alpine
pull: always
image: plugins/docker image: plugins/docker
group: release settings:
pull: true
dockerfile: Dockerfile.alpine
secrets: [ docker_username, docker_password ]
default_tags: true
default_suffix: alpine default_suffix: alpine
repo: ${DRONE_REPO} default_tags: true
when: dockerfile: Dockerfile.alpine
event: [ push, tag ]
local: false
publish_linux_amd64:
image: plugins/docker:17.05
pull: true
secrets: [ docker_username, docker_password ]
group: release group: release
repo: ${DRONE_REPO} repo: "${DRONE_REPO}"
environment:
DOCKER_PASSWORD:
from_secret: docker_password
DOCKER_USERNAME:
from_secret: docker_username
when:
event:
- push
- tag
- name: publish_linux_amd64
pull: always
image: plugins/docker:17.05
settings:
auto_tag: true auto_tag: true
dockerfile: Dockerfile dockerfile: Dockerfile
when:
event: [ push, tag ]
local: false
publish_linux_i386:
image: plugins/docker:17.05
pull: true
secrets: [ docker_username, docker_password ]
group: release group: release
repo: ${DRONE_REPO} repo: "${DRONE_REPO}"
environment:
DOCKER_PASSWORD:
from_secret: docker_password
DOCKER_USERNAME:
from_secret: docker_username
when:
event:
- push
- tag
- name: publish_linux_i386
pull: always
image: plugins/docker:17.05
settings:
auto_tag: true auto_tag: true
auto_tag_suffix: i386 auto_tag_suffix: i386
dockerfile: Dockerfile.i386 dockerfile: Dockerfile.i386
when:
event: [ push, tag ]
local: false
publish_linux_arm64:
image: plugins/docker:17.05
pull: true
secrets: [ docker_username, docker_password ]
group: release group: release
repo: ${DRONE_REPO} repo: "${DRONE_REPO}"
environment:
DOCKER_PASSWORD:
from_secret: docker_password
DOCKER_USERNAME:
from_secret: docker_username
when:
event:
- push
- tag
- name: publish_linux_arm64
pull: always
image: plugins/docker:17.05
settings:
auto_tag: true auto_tag: true
auto_tag_suffix: arm64 auto_tag_suffix: arm64
dockerfile: Dockerfile.arm64 dockerfile: Dockerfile.arm64
when:
event: [ push, tag ]
local: false
publish_linux_arm:
image: plugins/docker:17.05
pull: true
secrets: [ docker_username, docker_password ]
group: release group: release
repo: ${DRONE_REPO} repo: "${DRONE_REPO}"
environment:
DOCKER_PASSWORD:
from_secret: docker_password
DOCKER_USERNAME:
from_secret: docker_username
when:
event:
- push
- tag
- name: publish_linux_arm
pull: always
image: plugins/docker:17.05
settings:
auto_tag: true auto_tag: true
auto_tag_suffix: arm auto_tag_suffix: arm
dockerfile: Dockerfile.arm dockerfile: Dockerfile.arm
when:
event: [ push, tag ]
local: false
github:
image: plugins/github-release
pull: true
group: release group: release
secrets: [ github_release_api_key ] repo: "${DRONE_REPO}"
files: environment:
- dist/release/* DOCKER_PASSWORD:
from_secret: docker_password
DOCKER_USERNAME:
from_secret: docker_username
when: when:
event: [ tag ] event:
- push
- tag
discord: - name: github
image: appleboy/drone-discord pull: always
pull: true image: plugins/github-release
secrets: [ discord_webhook_id, discord_webhook_token ] settings:
files:
- "dist/release/*"
group: release
environment:
GITHUB_RELEASE_API_KEY:
from_secret: github_release_api_key
when: when:
status: [ changed, failure ] event:
- tag
- name: discord
pull: always
image: appleboy/drone-discord
environment:
DISCORD_WEBHOOK_ID:
from_secret: discord_webhook_id
DISCORD_WEBHOOK_TOKEN:
from_secret: discord_webhook_token
when:
status:
- changed
- failure
...