Skip to content

Latest commit

 

History

History
48 lines (35 loc) · 1.37 KB

CONTRIBUTING.md

File metadata and controls

48 lines (35 loc) · 1.37 KB

Debug

  1. Run the local plugin code with your debugging IDE of choice with something similar to go run ./... -debug.
  2. Set breakpoints in your IDE.
  3. In your shell, apply the resource you are working on.
    # export the printed environment variable from the go run ./... -debug command above. E.g.
    export TF_REATTACH_PROVIDERS='{"registry.terraform.io/zitadel/zitadel":{"Protocol":"grpc","ProtocolVersion":6,"Pid":8123,"Test":true,"Addr":{"Network":"unix","String":"/tmp/plugin275634719"}}}'
    
    # go to a directory containing .tf files.
    cd /my-zitadel-terraform-files
    
    # apply them
    terraform apply
  4. The execution stops at your breakpoints.

Run Acceptance Tests

Run a local ZITADEL instance using docker compose.

# To have the machine key written with the correct ownership, set your current users ID.
export ZITADEL_DEV_UID="$(id -u)"

# Setup ZITADEL
docker compose --file ./acceptance/docker-compose.yaml run setup

Run the accepance tests using the machine key generated by ZITADEL.

TF_ACC=1 go test ./...

Ensure the code is formatted correctly

go run github.com/golangci/golangci-lint/cmd/[email protected] run --fix

Generate Docs

  1. Manually maintain files in /templates and /examples
  2. Generate the docs
go run github.com/hashicorp/terraform-plugin-docs/cmd/[email protected] generate