Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Paul Lhussiez
committed
Oct 23, 2018
1 parent
a2b1fb5
commit 2ec76b6
Showing
7 changed files
with
223 additions
and
46 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,80 @@ | |||
workspace: | |||
base: /go | |||
path: src/[[ .repo ]] | |||
|
|||
[[ if .tags -]] | |||
clone: | |||
git: | |||
image: plugins/git | |||
tags: true | |||
[[- end ]] | |||
|
|||
pipeline: | |||
[[ if not .gomodules -]] | |||
prerequisites: | |||
image: "golang:[[ .goversion ]]" | |||
commands: | |||
- go version | |||
- go get -u github.com/golang/dep/cmd/dep | |||
- dep ensure -vendor-only | |||
environment: | |||
- GO111MODULE=off | |||
[[- end ]] | |||
[[ if .linter -]] | |||
linter: | |||
image: "golang:[[ .goversion ]]" | |||
commands: | |||
- go get -u github.com/golangci/golangci-lint/cmd/golangci-lint | |||
- golangci-lint run | |||
[[ if not .gomodules -]] | |||
environment: | |||
- GO111MODULE=off | |||
[[- end ]] | |||
[[- end ]] | |||
test: | |||
image: "golang:[[ .goversion ]]" | |||
commands: | |||
- go test -cover -failfast ./... | |||
[[ if not .gomodules -]] | |||
environment: | |||
- GO111MODULE=off | |||
[[- end ]] | |||
[[ if .slack -]] | |||
slack: | |||
image: plugins/slack | |||
channel: [[ .slack_channel ]] | |||
webhook: [[ .slack_webhook ]] | |||
username: Notification | |||
template: > | |||
{{#success build.status}} | |||
<{{build.link}}|Build {{build.number}}> by {{build.author}} succeeded in {{since build.started}} | |||
Version {{#if build.tag}}`{{build.tag}}`{{else}}`latest`{{/if}} deployed. | |||
`chatbot-backend:{{build.commit}}` | |||
{{else}} | |||
<{{build.link}}|Build {{build.number}}> by {{build.author}} failed in {{since build.started}} | |||
{{/success}} | |||
when: | |||
status: [ success, failure ] | |||
event: [ tag, push ] | |||
branch: master | |||
local: false | |||
|
|||
slack: | |||
image: plugins/slack | |||
channel: [[ .slack_channel ]] | |||
webhook: [[ .slack_webhook ]] | |||
username: Notification | |||
template: > | |||
{{#success build.status}} | |||
<{{build.link}}|Build {{build.number}}> on branch `{{build.branch}}` by {{build.author}} succeeded in {{since build.started}} | |||
{{else}} | |||
<{{build.link}}|Build {{build.number}}> on branch `{{build.branch}}` by {{build.author}} failed in {{since build.started}} | |||
{{/success}} | |||
when: | |||
status: [ success, failure ] | |||
branch: | |||
exclude: master | |||
local: false | |||
[[- end ]] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,37 @@ | |||
name: "Drone Template" | |||
version: "0.1.0" | |||
description: "Add a .drone.yml file to your project" | |||
delimiters: ["[[", "]]"] | |||
variables: | |||
goversion: | |||
default: "latest" | |||
prompt: "Which go version should be used?" | |||
repo: | |||
required: true | |||
prompt: "What's the full path of your project?" | |||
help: "Full path of your repo or go package, for example 'github.com/Depado/projectmpl'" | |||
gomodules: | |||
confirm: false | |||
prompt: "Use gomodules instead of dep?" | |||
linter: | |||
confirm: true | |||
prompt: "Use golangci-lint as the main linter?" | |||
slack: | |||
confirm: true | |||
prompt: "Add Slack integration?" | |||
variables: | |||
channel: | |||
required: true | |||
help: "Channel in which the build result should be posted. Should start with a # to work properly" | |||
prompt: "Slack channel:" | |||
webhook: | |||
required: true | |||
help: "See https://api.slack.com/incoming-webhooks for more information" | |||
prompt: "Provide the Slack webhook URL:" | |||
username: | |||
default: "Build Notification" | |||
prompt: "Username the integration will use to post in the channel:" | |||
tags: | |||
confirm: true | |||
prompt: "Clone with tags?" | |||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters