Skip to content

Latest commit

 

History

History
116 lines (73 loc) · 2.74 KB

CONTRIBUTING.md

File metadata and controls

116 lines (73 loc) · 2.74 KB

Contributing to DNSimple/terraform-dnsimple-dns-record-sync-nia

Getting started

1. Clone the repository

Clone the repository and move into it:

git clone [email protected]:dnsimple/terraform-dnsimple-cts.git
cd terraform-dnsimple-cts

2. Install dependencies

  1. Consul-Terraform-Sync
  2. Terraform
  3. Docker

Testing

Testing without running CTS and Consul

Add the required variables to test the integration.

cp test/terraform.tfvars.example test/terraform.tfvars

Plan:

terraform plan --var-file="test/terraform.tfvars"

Apply:

terraform apply --var-file="test/terraform.tfvars"

Testing e2e with Docker Compose

Add the required variables to test the integration. Making sure to comment out or remove the services variable.

cp test/terraform.tfvars.example test/terraform.tfvars

NOTE: If you had previously uncommented the services variable make sure to remove the variable or comment the variable out else the integration would not work, as CTS produces .tfvars file with the same variable when it receives an update from the consul server.

Startup the datacenter:

docker compose up -d
docker compose ps

Follow the logs:

docker compose logs -f

In a separate terminal run helper script to register/deregester services. But first ensure to update the Meta.zone_name attribute of the service config in test/api-service.json and test/web-service.json.

./test/servicesctl.sh <service_name> <action>

service_name - default: web, options: [web, api]
action       - default: register, options: [register, deregester]

Registerting a service:

./test/servicesctl.sh api register

Deregisterting a service:

./test/servicesctl.sh api deregister

NOTES:

  • The CTS container is stateless, which means that after shutting it down the tfstate will be lost.
  • You can add more services by creating a config with the following convention test/<service_name>-service.json, and then you can use the helper the same way with the new service.

Releasing

The following instructions uses $VERSION as a placeholder, where $VERSION is a MAJOR.MINOR.BUGFIX release such as 1.2.0.

  1. Run the test suite and ensure all the tests pass.

  2. Finalize the ## main section in CHANGELOG.md assigning the version.

  3. Commit and push the changes

    git commit -a -m "Release $VERSION"
    git push origin main
  4. Wait for CI to complete.

  5. Create a signed tag.

    git tag -a v$VERSION -s -m "Release $VERSION"
    git push origin --tags