Skip to content

Latest commit

 

History

History
77 lines (58 loc) · 2.62 KB

development.md

File metadata and controls

77 lines (58 loc) · 2.62 KB

Development

Go

In order to work on the provider, Go should be installed first (version 1.11+ is required). goenv and gvm are great utilities that can help a lot with that and simplify setup tremendously. GOPATH should be setup correctly and $GOPATH/bin should be added $PATH.

This plugin uses Go modules available starting from Go 1.11 and therefore it should not be checked out within $GOPATH tree.

Source Code

Source code can be retrieved with git

$ git clone [email protected]:ashald/terraform-provider-yaml.git .

Dependencies

This project uses go mod to manage its dependencies and it's expected that all dependencies are vendored so that it's buildable without internet access. When adding/removing a dependency run following commands:

$ go mod vendor
$ go mod tidy

Test

$ make test
  GOPROXY="off" GOFLAGS="-mod=vendor" go test -v ./...
  ?   	github.com/ashald/terraform-provider-yaml	[no test files]
  === RUN   TestListOfStringsDataSource
  --- PASS: TestListOfStringsDataSource (0.03s)
  === RUN   TestMapOfStringsDataSource
  --- PASS: TestMapOfStringsDataSource (0.06s)
  === RUN   TestYamlToJsonDataSource
  --- PASS: TestYamlToJsonDataSource (0.02s)
  === RUN   TestProvider
  --- PASS: TestProvider (0.00s)
  PASS
  ok  	github.com/ashald/terraform-provider-yaml/yaml	(cached)
  GOPROXY="off" GOFLAGS="-mod=vendor" go vet ./...

Build

In order to build plugin for the current platform use [GNU]make:

$ make build
  GOPROXY="off" GOFLAGS="-mod=vendor" go build -o terraform-provider-yaml_v2.1.0

it will build provider from sources and put it into current working directory.

If Terraform was installed (as a binary) or via go get -u github.com/hashicorp/terraform it'll pick up the plugin if executed against a configuration in the same directory.

Release

In order to prepare provider binaries for all platforms:

$ make release
  GOPROXY="off" GOFLAGS="-mod=vendor" GOOS=darwin GOARCH=amd64 go build -o './release/terraform-provider-yaml_v2.1.0-darwin-amd64'
  GOPROXY="off" GOFLAGS="-mod=vendor" GOOS=linux GOARCH=amd64 go build -o './release/terraform-provider-yaml_v2.1.0-linux-amd64'
  GOPROXY="off" GOFLAGS="-mod=vendor" GOOS=windows GOARCH=amd64 go build -o './release/terraform-provider-yaml_v2.1.0-windows-amd64'

Versioning

This project follow Semantic Versioning

Changelog

This project follows keep a changelog guidelines for changelog.