drone-ssh/.drone.yml
2017-04-21 17:16:55 +08:00

69 lines
1.3 KiB
YAML

workspace:
base: /srv/app
path: src/github.com/appleboy/drone-ssh
pipeline:
clone:
image: plugins/git
tags: true
test:
image: appleboy/golang-testing
pull: true
environment:
TAGS: netgo
GOPATH: /srv/app
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 ]
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}' ]
when:
event: [ tag ]
branch: [ refs/tags/* ]
local: false
publish_latest:
image: plugins/docker
repo: ${DRONE_REPO}
tags: [ 'latest' ]
when:
event: [ push ]
branch: [ master ]
local: false
release:
image: plugins/github-release
api_key: ${GITHUB_RELEASE_API_KEY}
files:
- dist/release/*
when:
event: [ tag ]
branch: [ refs/tags/* ]
local: false