John Engelman
9 years ago
2 changed files with 49 additions and 15 deletions
@ -1,28 +1,38 @@ |
|||
build: |
|||
image: golang:1.5 |
|||
environment: |
|||
- GO15VENDOREXPERIMENT=1 |
|||
- GOOS=linux |
|||
- GOARCH=amd64 |
|||
- CGO_ENABLED=0 |
|||
commands: |
|||
- go get |
|||
- go build |
|||
- go test |
|||
- make deps |
|||
- make vet |
|||
- make build |
|||
- make test |
|||
|
|||
publish: |
|||
coverage: |
|||
when: |
|||
branch: master |
|||
docker: |
|||
username: drone |
|||
username: $$DOCKER_USER |
|||
password: $$DOCKER_PASS |
|||
email: $$DOCKER_EMAIL |
|||
repo: objectpartners/drone-terraform |
|||
repo: plugins/drone-terraform |
|||
tag: latest |
|||
when: |
|||
branch: master |
|||
docker: |
|||
username: $$DOCKER_USER |
|||
password: $$DOCKER_PASS |
|||
email: $$DOCKER_EMAIL |
|||
repo: plugins/drone-terraform |
|||
tag: develop |
|||
when: |
|||
branch: develop |
|||
|
|||
plugin: |
|||
name: Terraform |
|||
desc: Execute Terraform commands |
|||
desc: Execute Terraform plan and apply |
|||
type: deploy |
|||
image: objectpartners/drone-terraform |
|||
image: plugins/drone-terraform |
|||
labels: |
|||
- terraform |
|||
|
@ -1,8 +1,32 @@ |
|||
deps: |
|||
GO15VENDOREXPERIMENT=1 go get -u ./... |
|||
.PHONY: clean deps fmt vet test docker |
|||
|
|||
EXECUTABLE ?= drone-terraform |
|||
IMAGE ?= plugins/$(EXECUTABLE) |
|||
CI_BUILD_NUMBER ?= 0 |
|||
|
|||
build: |
|||
GO15VENDOREXPERIMENT=1 GOOS=linux GOARCH=amd64 CGO_ENABLED=0 go build |
|||
LDFLAGS = -X "main.buildDate=$(shell date -u '+%Y-%m-%d %H:%M:%S %Z')" |
|||
PACKAGES = $(shell go list ./... | grep -v /vendor/) |
|||
|
|||
clean: |
|||
rm drone-terraform |
|||
go clean -i ./... |
|||
|
|||
deps: |
|||
go get -t ./... |
|||
|
|||
fmt: |
|||
go fmt $(PACKAGES) |
|||
|
|||
vet: |
|||
go vet $(PACKAGES) |
|||
|
|||
test: |
|||
@for PKG in $(PACKAGES); do go test -cover -coverprofile $$GOPATH/src/$$PKG/coverage.out $$PKG || exit 1; done; |
|||
|
|||
docker: |
|||
GOOS=linux GOARCH=amd64 CGO_ENABLED=0 go build -ldflags '-s -w $(LDFLAGS)' |
|||
docker build --rm -t $(IMAGE) . |
|||
|
|||
$(EXECUTABLE): $(wildcard *.go) |
|||
go build -ldflags '-s -w $(LDFLAGS)' |
|||
|
|||
build: $(EXECUTABLE) |
|||
|
Loading…
Reference in new issue