Skip to content

Commit

Permalink
Add registry docs option to bridged provider CI config (#1083)
Browse files Browse the repository at this point in the history
This pull request adds a `registryDocs` configuration option to the
provider CI.

When enabled, it will run `./bin/pulumi-tfgen-foo registry-docs --out
docs/`, automatically writing upstream installation documentation.

Note that in the Makefile, the functionality is added as a dependency to
`make_build_sdks`, for the following reasons:
1. In order to generate docs, the tfgen binary must be built, and the
`build` commands are based on the same assumption
1. These files are auto-generated; just like the SDKs they should be
generated at the end of an update
1. It avoids adding a new separate target all over our github Workflows
and upgrade-provider.

Part of pulumi/home#3598.
  • Loading branch information
guineveresaenger authored Sep 23, 2024
1 parent 5afb0cc commit 52751c4
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,9 @@ publish:
# Publish the plugin binaries to the Pulumi CDN (get.pulumi.com) - requires AWS credentials for S3 upload
cdn: true

# Enables automatic registry index doc file generation. Intended for use with Tier 2/3 providers.
registryDocs: false

# Set a path for each language example to enable the test
# releaseVerification:
# nodejs: examples/simple-nodejs
Expand Down Expand Up @@ -247,4 +250,4 @@ publish:
# # but do say mention (in README.md) that they are under Apache-2.0."
# - github.com/alibabacloud-go/endpoint-util/service
# - github.com/alibabacloud-go/tea-roa-utils/service
# - github.com/alibabacloud-go/tea-roa/client
# - github.com/alibabacloud-go/tea-roa/client
7 changes: 6 additions & 1 deletion provider-ci/internal/pkg/templates/bridged-provider/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ development: install_plugins provider build_sdks install_sdks

build: install_plugins provider build_sdks install_sdks

build_sdks: #{{ range .Config.languages }}#build_#{{ . }}# #{{ end }}#
build_sdks: #{{ range .Config.languages }}#build_#{{ . }}# #{{ end }}##{{- if .Config.registryDocs }}#build_registry_docs#{{- end }}#

install_go_sdk:

Expand Down Expand Up @@ -111,6 +111,11 @@ build_python: upstream
./venv/bin/python -m pip install build==1.2.1 && \
cd ./bin && \
../venv/bin/python -m build .
#{{- if .Config.registryDocs }}#

build_registry_docs:
cd provider && $(WORKING_DIR)/bin/$(TFGEN) registry-docs --out $(WORKING_DIR)/docs
#{{- end }}#

clean:
rm -rf sdk/{dotnet,nodejs,go,python}
Expand Down
1 change: 1 addition & 0 deletions provider-ci/test-providers/cloudflare/.ci-mgmt.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,4 @@ actions:
run: |
cd provider && go test -v -json -count=1 -cover -timeout 2h -tags=${{ matrix.language }} -parallel 4 . 2>&1 | tee /tmp/gotest.log | gotestfmt
pulumiConvert: 1
registryDocs: true
5 changes: 4 additions & 1 deletion provider-ci/test-providers/cloudflare/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ development: install_plugins provider build_sdks install_sdks

build: install_plugins provider build_sdks install_sdks

build_sdks: build_nodejs build_python build_dotnet build_go build_java
build_sdks: build_nodejs build_python build_dotnet build_go build_java build_registry_docs

install_go_sdk:

Expand Down Expand Up @@ -96,6 +96,9 @@ build_python: upstream
cd ./bin && \
../venv/bin/python -m build .

build_registry_docs:
cd provider && $(WORKING_DIR)/bin/$(TFGEN) registry-docs --out $(WORKING_DIR)/docs

clean:
rm -rf sdk/{dotnet,nodejs,go,python}

Expand Down
1 change: 1 addition & 0 deletions provider-ci/test-providers/docker/.ci-mgmt.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,3 +38,4 @@ actions:
with:
ssh-private-key: ${{ secrets.PRIVATE_SSH_KEY_FOR_DIGITALOCEAN }}
pulumiConvert: 1
registryDocs: true
5 changes: 4 additions & 1 deletion provider-ci/test-providers/docker/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ development: install_plugins provider build_sdks install_sdks

build: install_plugins provider build_sdks install_sdks

build_sdks: build_nodejs build_python build_dotnet build_go build_java
build_sdks: build_nodejs build_python build_dotnet build_go build_java build_registry_docs

install_go_sdk:

Expand Down Expand Up @@ -96,6 +96,9 @@ build_python: upstream
cd ./bin && \
../venv/bin/python -m build .

build_registry_docs:
cd provider && $(WORKING_DIR)/bin/$(TFGEN) registry-docs --out $(WORKING_DIR)/docs

clean:
rm -rf sdk/{dotnet,nodejs,go,python}

Expand Down

0 comments on commit 52751c4

Please sign in to comment.