Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: update cibuild make formula to build for any OS (windows, linu… #50

Merged
merged 4 commits into from
Apr 19, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ setenv.sh
request_log
.DS_Store
dist/
pkg/
terraform-provider-nutanix

# Test binary, build with `go test -c`
Expand Down
12 changes: 5 additions & 7 deletions GNUmakefile
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ lint: fmtcheck
tools:
GO111MODULE=off go get -u github.com/client9/misspell/cmd/misspell
GO111MODULE=off go get -u github.com/golangci/golangci-lint/cmd/golangci-lint

GO111MODULE=off go get github.com/mitchellh/gox

vet:
@echo "go vet ."
Expand All @@ -57,12 +57,10 @@ test-compile:
# TF_ACC=1 go test $(TEST) -v $(TESTARGS) -timeout 120m -coverprofile c.out
# 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
cibuild: tools
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
Expand Down
48 changes: 5 additions & 43 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -158,28 +158,6 @@ We'll be working with HashiCorp as code stabilizes to upstream this properly, at

[](https://github.com/golang/go)

#### Dep: Go dependency management tool

On MacOS you can install or upgrade to the latest released version with Homebrew:

```sh
$ brew install dep
$ brew upgrade dep
```

On other platforms you can use the `install.sh` script:

```sh
$ curl https://raw.githubusercontent.com/golang/dep/master/install.sh | sh
```

It will install into your `$GOPATH/bin` directory by default or any other directory you specify using the `INSTALL_DIRECTORY` environment variable.

If your platform is not supported, you'll need to build it manually or let the team (go/dep team) know and we'll consider adding your platform
to the release builds.

More Info: https://github.com/golang/dep

## Install from source

## Building from sources
Expand All @@ -191,11 +169,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):
Expand All @@ -204,26 +178,19 @@ More Info: https://github.com/golang/dep
go get -u github.com/golang/dep/cmd/dep
```

5. Get dependencies:
5. Run tests:

```bash
cd $GOPATH/src/github.com/terraform-providers/terraform-provider-nutanix
dep ensure
make test #unit tests
make testacc #acceptance tests
```

6. Run tests:
6. Build the binary:

```bash
cd $GOPATH/src/github.com/terraform-providers/terraform-provider-nutanix
make test
make testacc
```

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
Expand Down Expand Up @@ -275,11 +242,6 @@ Clone repository to: `$GOPATH/src/github.com/terraform-providers/terraform-provi

```sh
$ mkdir $GOPATH/src/github.com/terraform-providers && cd "$_" #if you already created it only change directory
<<<<<<< HEAD

=======
$
>>>>>>> chore: fix bad urls in readme.md file
$ git clone https://github.com/terraform-providers/terraform-provider-nutanix.git
```

Expand Down
1 change: 1 addition & 0 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 4 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -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=
Expand Down