Skip to content
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
5 changes: 4 additions & 1 deletion GNUmakefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ default: build
build:
go build -v ./...

install: build
go install -v ./...

# See https://golangci-lint.run/
lint:
golangci-lint run
Expand All @@ -19,4 +22,4 @@ test:
testacc:
TF_ACC=1 go test -v -cover -timeout 120m ./...

.PHONY: build lint generate fmt test testacc
.PHONY: build install lint generate fmt test testacc
39 changes: 34 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,9 @@ The remainder of this document will focus on the development aspects of the prov
* [GNU Make](https://www.gnu.org/software/make/)
* [golangci-lint](https://golangci-lint.run/usage/install/#local-installation) (optional)

## Building
## Development

### Building

1. `git clone` this repository and `cd` into its directory
2. `make` will trigger the Golang build
Expand Down Expand Up @@ -51,14 +53,41 @@ and associate it with the release version. Read more about how this works on the

Use `make generate` to ensure the documentation is regenerated with any changes.

### Using a development build

If [running tests and acceptance tests](#testing) isn't enough, it's possible to set up a local terraform configuration
to use a development builds of the provider. This can be achieved by leveraging the Terraform CLI
[configuration file development overrides](https://www.terraform.io/cli/config/config-file#development-overrides-for-provider-developers).

First, use `make install` to place a fresh development build of the provider in your [`${GOBIN}`](https://pkg.go.dev/cmd/go#hdr-Compile_and_install_packages_and_dependencies) (defaults to `${GOPATH}/bin` or `${HOME}/go/bin` if `${GOPATH}` is not set). Repeat
this every time you make changes to the provider locally.

Then, in your `${HOME}/.terraformrc` (Unix) / `%APPDATA%\terraform.rc` (Windows), a `provider_installation` that contains
the following `dev_overrides`:

```hcl
provider_installation {
dev_overrides {
"hashicorp/tls" = "${GOBIN}" //< replace `${GOBIN}` with the actual path on your system
}

direct {}
}
```

Note that it's also possible to use a dedicated Terraform configuration file and invoke `terraform` while setting
the environment variable `TF_CLI_CONFIG_FILE=my_terraform_config_file`.

Once the `dev_overrides` are in place, any local execution of `terraform plan` and `terraform apply` will
use the version of the provider found in the given `${GOBIN}` directory,
instead of the one indicated in your terraform configuration.

## Releasing

The release process is automated via GitHub Actions,
and it's defined in the Workflow [release.yml](./.github/workflows/release.yml).
The release process is automated via GitHub Actions, and it's defined in the Workflow
[release.yml](./.github/workflows/release.yml).

Each release is cut by pushing a [semantically versioned](https://semver.org/)
tag to the default branch.
Each release is cut by pushing a [semantically versioned](https://semver.org/) tag to the default branch.

## License

Expand Down