drone-ssh/.drone.yml
2017-05-08 09:06:35 +08:00

76 lines
1.5 KiB
YAML

workspace:
base: /srv/app
path: src/github.com/appleboy/drone-ssh
clone:
git:
image: plugins/git
depth: 50
tags: true
pipeline:
test:
image: appleboy/golang-testing
pull: true
environment:
TAGS: netgo
GOPATH: /srv/app
secrets: [ codecov_token ]
commands:
- make ssh-server
- make vet
- make lint
# - make test
- coverage all
- make coverage
- make build
# build binary for docker image
- make static_build
when:
event: [ push, tag, pull_request ]
publish_latest:
image: plugins/docker
repo: ${DRONE_REPO}
tags: [ 'latest' ]
secrets: [ docker_username, docker_password ]
when:
event: [ push ]
branch: [ master ]
local: false
release:
image: appleboy/golang-testing
pull: true
environment:
TAGS: netgo
GOPATH: /srv/app
commands:
- make release
when:
event: [ tag ]
branch: [ refs/tags/* ]
local: false
publish_tag:
image: plugins/docker
repo: ${DRONE_REPO}
tags: [ '${DRONE_TAG}' ]
secrets: [ docker_username, docker_password ]
group: release
when:
event: [ tag ]
branch: [ refs/tags/* ]
local: false
release_tag:
image: plugins/github-release
secrets: [ github_release_api_key ]
group: release
files:
- dist/release/*
when:
event: [ tag ]
branch: [ refs/tags/* ]
local: false