2016-12-07 07:43:17 +00:00
|
|
|
workspace:
|
|
|
|
path: /go/src/github.com/appleboy/gorush
|
|
|
|
|
2016-08-06 15:01:27 +00:00
|
|
|
pipeline:
|
2016-09-22 01:34:13 +00:00
|
|
|
# restore the cache from an sftp server
|
|
|
|
restore_cache:
|
|
|
|
image: appleboy/drone-sftp-cache
|
|
|
|
restore: true
|
|
|
|
mount: [ .glide, vendor ]
|
|
|
|
ignore_branch: true
|
|
|
|
|
2016-08-06 15:01:27 +00:00
|
|
|
build:
|
2016-08-29 07:32:03 +00:00
|
|
|
image: appleboy/golang-testing:${GO_VERSION}
|
2016-08-06 15:01:27 +00:00
|
|
|
environment:
|
|
|
|
- GOPATH=/go
|
|
|
|
commands:
|
2016-12-07 08:46:27 +00:00
|
|
|
- make dep_install
|
2016-12-07 09:37:43 +00:00
|
|
|
- make vet
|
|
|
|
- make lint
|
|
|
|
- make build
|
2016-12-07 09:00:22 +00:00
|
|
|
- coverage all
|
2016-12-08 03:43:23 +00:00
|
|
|
# send coverage report
|
2016-12-07 13:33:03 +00:00
|
|
|
- curl -s https://codecov.io/bash > .codecov &&
|
|
|
|
chmod +x .codecov &&
|
|
|
|
./.codecov -t ${CODECOV_TOKEN} -f .cover/coverage.txt
|
2016-12-07 09:37:43 +00:00
|
|
|
# build binary for docker image
|
|
|
|
- make docker_binary_build
|
2016-12-07 08:46:27 +00:00
|
|
|
|
2016-12-08 03:43:23 +00:00
|
|
|
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.4
|
|
|
|
|
2016-12-07 08:46:27 +00:00
|
|
|
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 ]
|
2016-08-06 15:01:27 +00:00
|
|
|
|
2016-09-28 02:12:08 +00:00
|
|
|
facebook:
|
|
|
|
image: appleboy/drone-facebook
|
|
|
|
pull: true
|
|
|
|
to: 1234973386524610
|
|
|
|
when:
|
|
|
|
status: [ success, failure ]
|
2016-10-02 14:05:13 +00:00
|
|
|
matrix:
|
2016-12-07 07:43:17 +00:00
|
|
|
GO_VERSION: 1.7.4
|
2016-09-28 02:12:08 +00:00
|
|
|
|
2016-12-08 03:43:23 +00:00
|
|
|
github:
|
|
|
|
image: plugins/github-release
|
|
|
|
files:
|
|
|
|
- dist/release/*
|
|
|
|
when:
|
|
|
|
event: [ tag ]
|
|
|
|
branch: [ refs/tags/* ]
|
|
|
|
matrix:
|
|
|
|
GO_VERSION: 1.7.4
|
|
|
|
|
2016-09-22 01:34:13 +00:00
|
|
|
# rebuild the cache on the sftp server
|
|
|
|
rebuild_cache:
|
|
|
|
image: appleboy/drone-sftp-cache
|
|
|
|
rebuild: true
|
|
|
|
mount: [ .glide, vendor ]
|
|
|
|
ignore_branch: true
|
2016-09-22 08:34:07 +00:00
|
|
|
when:
|
|
|
|
branch: master
|
2016-10-03 05:42:29 +00:00
|
|
|
matrix:
|
2016-12-07 07:43:17 +00:00
|
|
|
GO_VERSION: 1.7.4
|
2016-09-22 01:34:13 +00:00
|
|
|
|
2016-08-06 15:01:27 +00:00
|
|
|
services:
|
|
|
|
redis:
|
|
|
|
image: redis:alpine
|
|
|
|
|
2016-08-29 07:32:03 +00:00
|
|
|
matrix:
|
|
|
|
GO_VERSION:
|
2016-12-07 07:43:17 +00:00
|
|
|
- 1.7.4
|
|
|
|
- 1.6.4
|