Skip to content

Commit

Permalink
docs: Custom Terraform Provider
Browse files Browse the repository at this point in the history
Signed-off-by: Dennis Kniep <[email protected]>
  • Loading branch information
denniskniep committed Jan 9, 2025
1 parent ca420d2 commit 2b10d82
Showing 1 changed file with 36 additions and 1 deletion.
37 changes: 36 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,42 @@ Build binary:
make build
```

## Regression Tests
### Custom Terraform Provider

If you want to build this crossplane provider on top of a forked `terraform-provider-keycloak` follow these instructions:

1. Execute code generation:
```
TERRAFORM_PROVIDER_REPO=https://github.com/<owner>/terraform-provider-keycloak \
TERRAFORM_PROVIDER_VERSION=1.0.0 \
make generate
```
**Hint:** `TERRAFORM_PROVIDER_VERSION` must be a Release. Releases can be found here: `https://github.com/<owner>/terraform-provider-keycloak/releases`.
Every ReleaseName should have the prefix "v" (i.e 'v1.0.0'). But if you specify the `TERRAFORM_PROVIDER_VERSION` you need to
skip that prefix (i.e. '1.0.0')

2. Use forked repo as go dependency:
```
go mod edit -replace="github.com/keycloak/[email protected]=github.com/<owner>/[email protected]"
go mod tidy
```
**Hint:** You can also specify the version as `github.com/<owner>/[email protected]<timestamp>-<commitHash>`

3. Build and publish to custom repo

If you want to build and publish with CI, then add following to [GithubRepo > Settings > Secrets and variables > Actions](https://github.com/denniskniep/provider-keycloak/settings/secrets/actions)

Variables > Repository variables
* TERRAFORM_PROVIDER_REPO=https://github.com/<owner>/terraform-provider-keycloak
* TERRAFORM_PROVIDER_VERSION=1.0.0
* UPBOUND_MARKETPLACE_PUSH_ROBOT_USR=<user>
* XPKG_REG_ORGS=xpkg.upbound.io/<repo>
* XPKG_REG_ORGS_NO_PROMOTE=xpkg.upbound.io/<repo>

Secrets > Repository secrets
* UPBOUND_MARKETPLACE_PUSH_ROBOT_PSW=<password>

## Regression Tests
TODO: Add regression test docs

## Report a Bug
Expand Down

0 comments on commit 2b10d82

Please sign in to comment.