Improve Makefile for go modules and travis

Signed-off-by: solidnerd <niclas@mietz.io>
This commit is contained in:
solidnerd 2019-10-25 10:09:44 +02:00
parent 7a4a86f9e1
commit 86b237fe4e
No known key found for this signature in database
GPG Key ID: C300D44AB5469BE5
5 changed files with 26 additions and 19 deletions

1
.gitignore vendored
View File

@ -3,3 +3,4 @@ examples/*_override.tf
*~*
*.bak
bin

View File

@ -2,6 +2,10 @@ dist: xenial
language: go
cache:
directories:
- $HOME/.cache/go-build
- $HOME/gopath/pkg/mod
go:
- 1.13.x
@ -14,5 +18,4 @@ notifications:
email: false
script:
- make
- make install
- make test build install

View File

@ -1,27 +1,32 @@
.PHONY: build clean install
.PHONY: build fmt vet test clean install
all: build
setup:
go get github.com/Telmate/proxmox-api-go
go get github.com/hashicorp/terraform/plugin
go get github.com/hashicorp/terraform/terraform
go get github.com/Telmate/terraform-provider-proxmox/cmd/terraform-provider-proxmox
go get github.com/Telmate/terraform-provider-proxmox/cmd/terraform-provisioner-proxmox
fmt:
@echo " -> checking code style"
@! gofmt -d $(shell find . -path ./vendor -prune -o -name '*.go' -print) | grep '^'
vet:
@echo " -> vetting code"
@go vet ./...
test:
@echo " -> testing code"
@go test -v ./...
build: clean
@echo " -> Building"
@cd cmd/terraform-provider-proxmox && go build
mkdir -p bin
CGO_ENABLED=0 go build -o bin/terraform-provider-proxmox cmd/terraform-provider-proxmox/*
@echo "Built terraform-provider-proxmox"
@cd cmd/terraform-provisioner-proxmox && go build
CGO_ENABLED=0 go build -v -o bin/terraform-provisioner-proxmox cmd/terraform-provisioner-proxmox/*
@echo "Built terraform-provisioner-proxmox"
install: clean
@echo " -> Installing"
go install github.com/Telmate/terraform-provider-proxmox/cmd/terraform-provider-proxmox
go install github.com/Telmate/terraform-provider-proxmox/cmd/terraform-provisioner-proxmox
install: build
cp bin/terraform-provider-proxmox $$GOPATH/bin/terraform-provider-proxmox
cp bin/terraform-provisioner-proxmox $$GOPATH/bin/terraform-provider-proxmox
clean:
@git clean -f -d -X

View File

@ -1 +0,0 @@
terraform-provider-proxmox

View File

@ -1 +0,0 @@
terraform-provisioner-proxmox