Skip to content
This repository has been archived by the owner on Dec 15, 2022. It is now read-only.

Directions for calling ./hack/prepare.sh in the provider guide #167

Merged
merged 1 commit into from
Dec 3, 2021
Merged
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
12 changes: 3 additions & 9 deletions docs/generating-a-provider.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,17 +20,11 @@ be quite similar for any other Terraform provider.
export ProviderNameUpper=GitHub
```

2. Replace all occurrences of `template` with your provider name:
2. Run the `./hack/prepare.sh` script from repo root to prepare the repo, e.g., to
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like hack/prepare.sh wasn't committed.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh sorry!

replace all occurrences of `template` with your provider name:

```bash
git grep -l 'template' -- './*' ':!build/**' ':!go.sum' | xargs sed -i.bak "s/template/${ProviderNameLower}/g"
git grep -l 'Template' -- './*' ':!build/**' ':!go.sum' | xargs sed -i.bak "s/Template/${ProviderNameUpper}/g"
# Clean up the .bak files created by sed
git clean -fd

git mv "internal/clients/template.go" "internal/clients/${ProviderNameLower}.go"
git mv "cluster/images/provider-jet-template" "cluster/images/provider-jet-${ProviderNameLower}"
git mv "cluster/images/provider-jet-template-controller" "cluster/images/provider-jet-${ProviderNameLower}-controller"
./hack/prepare.sh
```

4. Configure your repo for the Terraform provider binary and schema:
Expand Down