diff --git a/.gitignore b/.gitignore index 093b57dea..663a7450c 100644 --- a/.gitignore +++ b/.gitignore @@ -10,6 +10,7 @@ setenv.sh request_log .DS_Store dist/ +pkg/ terraform-provider-nutanix # Test binary, build with `go test -c` diff --git a/GNUmakefile b/GNUmakefile index 8c0b3dfc7..8c8e281ae 100644 --- a/GNUmakefile +++ b/GNUmakefile @@ -58,11 +58,10 @@ test-compile: # go tool cover -html=c.out cibuild: - go build -# env GOOS=darwin GOARCH=amd64 go build -# env GOOS=windows GOARCH=amd64 go build -# env GOOS=linux GOARCH=amd64 go build -# env GOOS=linux GOARCH=ppc64 go build + go get github.com/mitchellh/gox + rm -rf pkg/ + gox -output "pkg/{{.OS}}_{{.Arch}}/terraform-provider-nutanix" + citest: TF_ACC=1 go test $(TEST) -v $(TESTARGS) -timeout 120m -coverprofile c.out diff --git a/README.md b/README.md index 294c4bd4f..539931825 100644 --- a/README.md +++ b/README.md @@ -191,11 +191,7 @@ More Info: https://github.com/golang/dep 3. Clone the repository: ```bash -<<<<<<< HEAD - git clone terraform-providers/terraform-provider-nutanix.git $GOPATH/src/github.com/terraform-providers/terraform-provider-nutanix -======= git clone https://github.com/terraform-providers/terraform-provider-nutanix.git $GOPATH/src/github.com/terraform-providers/terraform-provider-nutanix ->>>>>>> chore: fix bad urls in readme.md file ``` 4. Install [golang/dep](https://github.com/golang/dep): @@ -215,15 +211,15 @@ More Info: https://github.com/golang/dep ```bash cd $GOPATH/src/github.com/terraform-providers/terraform-provider-nutanix - make test - make testacc + make test #unit tests + make testacc #acceptance tests ``` 7. Build the binary: ```bash cd $GOPATH/src/github.com/terraform-providers/terraform-provider-nutanix - go build + make cibuild #it will create a pkg folder with the binaries for all OS including linux, windows, macOS ``` ## Release it diff --git a/go.mod b/go.mod index 4e410cbcd..336f8b24e 100644 --- a/go.mod +++ b/go.mod @@ -44,6 +44,7 @@ require ( github.com/mitchellh/cli v0.0.0-20180414170447-c48282d14eba // indirect github.com/mitchellh/go-homedir v1.1.0 // indirect github.com/mitchellh/go-testing-interface v0.0.0-20171004221916-a61a99592b77 // indirect + github.com/mitchellh/gox v1.0.1 // indirect github.com/mitchellh/hashstructure v0.0.0-20170609045927-2bca23e0e452 // indirect github.com/nbutton23/zxcvbn-go v0.0.0-20180912185939-ae427f1e4c1d // indirect github.com/onsi/ginkgo v1.8.0 // indirect diff --git a/go.sum b/go.sum index 942ddb484..6794af505 100644 --- a/go.sum +++ b/go.sum @@ -315,9 +315,13 @@ github.com/mitchellh/go-testing-interface v0.0.0-20171004221916-a61a99592b77 h1: github.com/mitchellh/go-testing-interface v0.0.0-20171004221916-a61a99592b77/go.mod h1:kRemZodwjscx+RGhAo8eIhFbs2+BFgRtFPeD/KE+zxI= github.com/mitchellh/go-wordwrap v0.0.0-20150314170334-ad45545899c7 h1:DpOJ2HYzCv8LZP15IdmG+YdwD2luVPHITV96TkirNBM= github.com/mitchellh/go-wordwrap v0.0.0-20150314170334-ad45545899c7/go.mod h1:ZXFpozHsX6DPmq2I0TCekCxypsnAUbP2oI0UX1GXzOo= +github.com/mitchellh/gox v1.0.1 h1:x0jD3dcHk9a9xPSDN6YEL4xL6Qz0dvNYm8yZqui5chI= +github.com/mitchellh/gox v1.0.1/go.mod h1:ED6BioOGXMswlXa2zxfh/xdd5QhwYliBFn9V18Ap4z4= github.com/mitchellh/hashstructure v0.0.0-20160209213820-6b17d669fac5/go.mod h1:QjSHrPWS+BGUVBYkbTZWEnOh3G1DutKwClXU/ABz6AQ= github.com/mitchellh/hashstructure v0.0.0-20170609045927-2bca23e0e452 h1:hOY53G+kBFhbYFpRVxHl5eS7laP6B1+Cq+Z9Dry1iMU= github.com/mitchellh/hashstructure v0.0.0-20170609045927-2bca23e0e452/go.mod h1:QjSHrPWS+BGUVBYkbTZWEnOh3G1DutKwClXU/ABz6AQ= +github.com/mitchellh/iochan v1.0.0 h1:C+X3KsSTLFVBr/tK1eYN/vs4rJcvsiLU338UhYPJWeY= +github.com/mitchellh/iochan v1.0.0/go.mod h1:JwYml1nuB7xOzsp52dPpHFffvOCDupsG0QubkSMEySY= github.com/mitchellh/mapstructure v0.0.0-20170307201123-53818660ed49/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= github.com/mitchellh/mapstructure v0.0.0-20180220230111-00c29f56e238/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= github.com/mitchellh/mapstructure v1.1.2 h1:fmNYVwqnSfB9mZU6OS2O6GsXM+wcskZDuKQzvN1EDeE=