refactor: add group build for drone. (#97)

* refactor: add group build for drone.

* remove codecov_token

Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>

* fix format

Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>

* fix path

Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
This commit is contained in:
Bo-Yi Wu 2017-08-15 14:52:35 +08:00 committed by GitHub
parent 14fddbbba5
commit e057a699a4
2 changed files with 32 additions and 11 deletions

View File

@ -9,24 +9,48 @@ clone:
tags: true
pipeline:
test:
lint:
image: appleboy/golang-testing
pull: true
group: golang
environment:
TAGS: netgo
GOPATH: /srv/app
secrets: [ codecov_token ]
commands:
- make ssh-server
- make vet
- make lint
# - make test
- make test-vendor
- coverage all
- make coverage
build:
image: appleboy/golang-testing
pull: true
group: golang
environment:
TAGS: netgo
GOPATH: /srv/app
commands:
- make build
test:
image: appleboy/golang-testing
pull: true
group: golang
environment:
TAGS: netgo
GOPATH: /srv/app
commands:
- make ssh-server
- make test
- make coverage
codecov:
image: robertstettner/drone-codecov
secrets: [ codecov_token ]
files:
- .cover/coverage.txt
when:
event: [ push, tag, pull_request ]
event: [ push, pull_request ]
status: [ success ]
publish_latest:
image: plugins/docker

View File

@ -125,10 +125,7 @@ endif
docker push $(DEPLOY_ACCOUNT)/$(DEPLOY_IMAGE):$(tag)
coverage:
sed -i '/main.go/d' .cover/coverage.txt
curl -s https://codecov.io/bash > .codecov && \
chmod +x .codecov && \
./.codecov -f .cover/coverage.txt
sed -i '/main.go/d' coverage.txt
clean:
$(GO) clean -x -i ./...