Skip to content

Commit

Permalink
Merge pull request Telmate#106 from solidnerd/improve-makefile
Browse files Browse the repository at this point in the history
Improve Makefile for go modules and travis
  • Loading branch information
ggongaware committed Nov 4, 2019
2 parents 0f7edc6 + 86b237f commit 3cc0dd2
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 19 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@ examples/*_override.tf

*~*
*.bak
bin
7 changes: 5 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@ dist: xenial

language: go

cache:
directories:
- $HOME/.cache/go-build
- $HOME/gopath/pkg/mod
go:
- 1.13.x

Expand All @@ -14,5 +18,4 @@ notifications:
email: false

script:
- make
- make install
- make test build install
35 changes: 20 additions & 15 deletions Makefile
Original file line number Diff line number Diff line change
@@ -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
1 change: 0 additions & 1 deletion cmd/terraform-provider-proxmox/.gitignore

This file was deleted.

1 change: 0 additions & 1 deletion cmd/terraform-provisioner-proxmox/.gitignore

This file was deleted.

0 comments on commit 3cc0dd2

Please sign in to comment.