Skip to content
Permalink
Browse files

Improving drone template

  • Loading branch information...
Depado committed Oct 23, 2018
1 parent 2297d87 commit 2501fb599e0c6c5caefd0d843b206eff2d0f10f5
Showing with 22 additions and 11 deletions.
  1. +1 −0 .goreleaser.yml
  2. +5 −1 Makefile
  3. +7 −5 _example/drone/.drone.yml
  4. +9 −5 _example/drone/.projectmpl.yml
@@ -1,6 +1,7 @@
builds:
- goarch: [amd64, arm, arm64, 386]
goarm: [6, 7]
goos: [linux,darwin,windows]
env:
- CGO_ENABLED=0
ldflags:
@@ -15,7 +15,11 @@ build: ## Build

.PHONY: release
release: ## Create a new release on Github
VERSION=$(VERSION) BUILD=$(BUILD) goreleaser --snapshot
VERSION=$(VERSION) BUILD=$(BUILD) goreleaser

.PHONY: snapshot
snapshot: ## Create a new snapshot release
VERSION=$(VERSION) BUILD=$(BUILD) goreleaser --snapshot --rm-dist

.PHONY: test
test: ## Run the test suite
@@ -1,6 +1,6 @@
workspace:
base: /go
path: src/[[ .repo ]]
path: src/[[ .gitserver ]]/[[ .organization ]]/[[ .name ]]

[[ if .tags -]]
clone:
@@ -44,14 +44,16 @@ pipeline:
image: plugins/slack
channel: [[ .slack_channel ]]
webhook: [[ .slack_webhook ]]
username: Notification
[[ if not eq .slack_username "" -]]
username: [[ .slack_username ]]
[[- end ]]
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.
Version {{#if build.tag}}`{{build.tag}}`{{else}}`latest`{{/if}} built.
`chatbot-backend:{{build.commit}}`
`[[ .name ]]:{{build.commit}}`
{{else}}
<{{build.link}}|Build {{build.number}}> by {{build.author}} failed in {{since build.started}}
{{/success}}
@@ -65,7 +67,7 @@ pipeline:
image: plugins/slack
channel: [[ .slack_channel ]]
webhook: [[ .slack_webhook ]]
username: Notification
username: [[ .slack_username ]]
template: >
{{#success build.status}}
<{{build.link}}|Build {{build.number}}> on branch `{{build.branch}}` by {{build.author}} succeeded in {{since build.started}}
@@ -3,13 +3,18 @@ version: "0.1.0"
description: "Add a .drone.yml file to your project"
delimiters: ["[[", "]]"]
variables:
name:
prompt: "What's the name of your repo?"
required: true
organization:
prompt: "What's your username or organization's name?"
required: true
gitserver:
default: "github.com"
help: "Git server"
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?"
@@ -29,7 +34,6 @@ variables:
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

0 comments on commit 2501fb5

Please sign in to comment.
You can’t perform that action at this time.