98 lines
1.8 KiB
YAML
98 lines
1.8 KiB
YAML
workspace:
|
|
path: /go/src/github.com/appleboy/gorush
|
|
|
|
pipeline:
|
|
clone:
|
|
image: plugins/git
|
|
tags: true
|
|
|
|
# restore the cache from an sftp server
|
|
restore_cache:
|
|
image: appleboy/drone-sftp-cache
|
|
restore: true
|
|
mount: [ .glide, vendor ]
|
|
ignore_branch: true
|
|
|
|
build:
|
|
image: appleboy/golang-testing:${GO_VERSION}
|
|
environment:
|
|
- GOPATH=/go
|
|
commands:
|
|
- make dep_install
|
|
- make vet
|
|
- make lint
|
|
- make build
|
|
- coverage all
|
|
# send coverage report
|
|
- make coverage
|
|
# build binary for docker image
|
|
- make docker_build
|
|
|
|
release:
|
|
image: appleboy/golang-testing:${GO_VERSION}
|
|
pull: true
|
|
environment:
|
|
TAGS: netgo
|
|
commands:
|
|
- make release
|
|
when:
|
|
event: [ tag ]
|
|
branch: [ refs/tags/* ]
|
|
matrix:
|
|
GO_VERSION: 1.7.5
|
|
|
|
docker:
|
|
image: plugins/docker
|
|
repo: appleboy/gorush
|
|
tags: [ '${DRONE_TAG}' ]
|
|
when:
|
|
event: [ tag ]
|
|
branch: [ refs/tags/* ]
|
|
|
|
docker:
|
|
image: plugins/docker
|
|
repo: appleboy/gorush
|
|
tags: [ 'latest' ]
|
|
when:
|
|
event: [ push ]
|
|
branch: [ master ]
|
|
|
|
facebook:
|
|
image: appleboy/drone-facebook
|
|
pull: true
|
|
to: 1234973386524610
|
|
when:
|
|
status: [ success, failure ]
|
|
matrix:
|
|
GO_VERSION: 1.7.5
|
|
|
|
github:
|
|
image: plugins/github-release
|
|
files:
|
|
- dist/release/*
|
|
when:
|
|
event: [ tag ]
|
|
branch: [ refs/tags/* ]
|
|
matrix:
|
|
GO_VERSION: 1.7.5
|
|
|
|
# rebuild the cache on the sftp server
|
|
rebuild_cache:
|
|
image: appleboy/drone-sftp-cache
|
|
rebuild: true
|
|
mount: [ .glide, vendor ]
|
|
ignore_branch: true
|
|
when:
|
|
branch: master
|
|
matrix:
|
|
GO_VERSION: 1.7.5
|
|
|
|
services:
|
|
redis:
|
|
image: redis:alpine
|
|
|
|
matrix:
|
|
GO_VERSION:
|
|
- 1.7.5
|
|
- 1.6.4
|