Clone the repository and move into it:
git clone [email protected]:dnsimple/terraform-provider-dnsimple.git
cd terraform-provider-dnsimple
If you wish to work on the provider, you'll first need Go installed on your machine (version 1.18+ is required). You'll also need to correctly setup a GOPATH, as well as adding $GOPATH/bin to your $PATH.
To compile the provider, run make build. This will build the provider and put the provider binary in the $GOPATH/bin directory.
$ make build
...
$ $GOPATH/bin/terraform-provider-dnsimple
...
make test
You can also run the integration tests like:
DNSIMPLE_ACCOUNT=12345 DNSIMPLE_TOKEN="adf23cf" DNSIMPLE_DOMAIN=example.com DNSIMPLE_SANDBOX=true make testacc
Our sandbox environment does not allow purchasing or issue certificates. For that reason, if you want to test the
resource_dnsimple_lets_encrypt_certificate
you will have to run the tests in production
(setting DNSIMPLE_SANDBOX=false
in the shell).
You will have to set the following env variables in your shell:
DNSIMPLE_CERTIFICATE_NAME
the name for which to request the certificate i.e. wwwDNSIMPLE_CERTIFICATE_ID
the certificate ID used in the datasource test
Sideload the plugin
make install
# Replace `darwin_arm64` with your arch. GOBIN should be where the Go built binary is installed to.
ln -s "$GOBIN/terraform-provider-dnsimple" "$HOME/.terraform.d/plugins/terraform.local/dnsimple/dnsimple/0.1.0/darwin_arm64/."
Use this as the provider configuration:
dnsimple = {
source = "terraform.local/dnsimple/dnsimple"
version = "0.1.0"
}
You can use the ./example/simple.tf
config to test the provider.
cd example
terraform init && terraform apply --auto-approve
The following instructions uses $VERSION
as a placeholder, where $VERSION
is a MAJOR.MINOR.BUGFIX
release such as 1.2.0
.
-
Run the test suite and ensure all the tests pass.
-
Finalize the
## main
section inCHANGELOG.md
assigning the version. -
Commit and push the changes
git commit -a -m "Release $VERSION" git push origin main
-
Wait for CI to complete.
-
Create a signed tag.
git tag -a v$VERSION -s -m "Release $VERSION" git push origin --tags
-
CI and goreleaser will handle the rest