diff --git a/.ci-mgmt.yaml b/.ci-mgmt.yaml new file mode 100644 index 00000000..d3d0765b --- /dev/null +++ b/.ci-mgmt.yaml @@ -0,0 +1,10 @@ +provider: nomad +major-version: 2 +setup-script: "testing/setup.sh" +env: + VAULT_ADDR: "http://127.0.0.1:4646" +makeTemplate: bridged +plugins: + - name: random + version: "4.2.0" +team: ecosystem diff --git a/.github/workflows/command-dispatch.yml b/.github/workflows/command-dispatch.yml index fb2af5cf..9d8308e5 100644 --- a/.github/workflows/command-dispatch.yml +++ b/.github/workflows/command-dispatch.yml @@ -9,7 +9,7 @@ env: GOVERSION: 1.21.x JAVAVERSION: "11" NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} - NODEVERSION: 16.x + NODEVERSION: 20.x NPM_TOKEN: ${{ secrets.NPM_TOKEN }} NUGET_PUBLISH_KEY: ${{ secrets.NUGET_PUBLISH_KEY }} PUBLISH_REPO_PASSWORD: ${{ secrets.OSSRH_PASSWORD }} diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 4fc01e9a..5094ee54 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -14,7 +14,7 @@ env: GOVERSION: 1.21.x JAVAVERSION: "11" NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} - NODEVERSION: 16.x + NODEVERSION: 20.x NPM_TOKEN: ${{ secrets.NPM_TOKEN }} NUGET_PUBLISH_KEY: ${{ secrets.NUGET_PUBLISH_KEY }} PUBLISH_REPO_PASSWORD: ${{ secrets.OSSRH_PASSWORD }} diff --git a/.github/workflows/master.yml b/.github/workflows/master.yml index 310b9edb..8f57ec79 100644 --- a/.github/workflows/master.yml +++ b/.github/workflows/master.yml @@ -9,7 +9,7 @@ env: GOVERSION: 1.21.x JAVAVERSION: "11" NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} - NODEVERSION: 16.x + NODEVERSION: 20.x NPM_TOKEN: ${{ secrets.NPM_TOKEN }} NUGET_PUBLISH_KEY: ${{ secrets.NUGET_PUBLISH_KEY }} PUBLISH_REPO_PASSWORD: ${{ secrets.OSSRH_PASSWORD }} diff --git a/.github/workflows/prerelease.yml b/.github/workflows/prerelease.yml index 2c0d232a..536cab59 100644 --- a/.github/workflows/prerelease.yml +++ b/.github/workflows/prerelease.yml @@ -10,7 +10,7 @@ env: GOVERSION: 1.21.x JAVAVERSION: "11" NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} - NODEVERSION: 16.x + NODEVERSION: 20.x NPM_TOKEN: ${{ secrets.NPM_TOKEN }} NUGET_PUBLISH_KEY: ${{ secrets.NUGET_PUBLISH_KEY }} PUBLISH_REPO_PASSWORD: ${{ secrets.OSSRH_PASSWORD }} diff --git a/.github/workflows/pull-request.yml b/.github/workflows/pull-request.yml index 43658f0a..af3e2e23 100644 --- a/.github/workflows/pull-request.yml +++ b/.github/workflows/pull-request.yml @@ -9,7 +9,7 @@ env: GOVERSION: 1.21.x JAVAVERSION: "11" NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} - NODEVERSION: 16.x + NODEVERSION: 20.x NPM_TOKEN: ${{ secrets.NPM_TOKEN }} NUGET_PUBLISH_KEY: ${{ secrets.NUGET_PUBLISH_KEY }} PUBLISH_REPO_PASSWORD: ${{ secrets.OSSRH_PASSWORD }} diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index e10683cc..9f6b5ddd 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -9,7 +9,7 @@ env: GOVERSION: 1.21.x JAVAVERSION: "11" NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} - NODEVERSION: 16.x + NODEVERSION: 20.x NPM_TOKEN: ${{ secrets.NPM_TOKEN }} NUGET_PUBLISH_KEY: ${{ secrets.NUGET_PUBLISH_KEY }} PUBLISH_REPO_PASSWORD: ${{ secrets.OSSRH_PASSWORD }} diff --git a/.github/workflows/resync-build.yml b/.github/workflows/resync-build.yml index 3a70da07..60c76511 100644 --- a/.github/workflows/resync-build.yml +++ b/.github/workflows/resync-build.yml @@ -11,7 +11,7 @@ env: GOVERSION: 1.21.x JAVAVERSION: "11" NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} - NODEVERSION: 16.x + NODEVERSION: 20.x NPM_TOKEN: ${{ secrets.NPM_TOKEN }} NUGET_PUBLISH_KEY: ${{ secrets.NUGET_PUBLISH_KEY }} PUBLISH_REPO_PASSWORD: ${{ secrets.OSSRH_PASSWORD }} diff --git a/.github/workflows/run-acceptance-tests.yml b/.github/workflows/run-acceptance-tests.yml index 24f5a3ae..5a9a78ae 100644 --- a/.github/workflows/run-acceptance-tests.yml +++ b/.github/workflows/run-acceptance-tests.yml @@ -10,7 +10,7 @@ env: GOVERSION: 1.21.x JAVAVERSION: "11" NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} - NODEVERSION: 16.x + NODEVERSION: 20.x NPM_TOKEN: ${{ secrets.NPM_TOKEN }} NUGET_PUBLISH_KEY: ${{ secrets.NUGET_PUBLISH_KEY }} PUBLISH_REPO_PASSWORD: ${{ secrets.OSSRH_PASSWORD }} diff --git a/.github/workflows/update-bridge.yml b/.github/workflows/update-bridge.yml deleted file mode 100644 index 17287db6..00000000 --- a/.github/workflows/update-bridge.yml +++ /dev/null @@ -1,91 +0,0 @@ -# WARNING: This file is autogenerated - changes will be overwritten if not made via https://github.com/pulumi/ci-mgmt - -env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - PULUMI_EXTRA_MAPPING_ERROR: false - PULUMI_MISSING_MAPPING_ERROR: false -jobs: - update_bridge: - name: update-bridge - runs-on: ubuntu-latest - steps: - - name: Checkout Repo - uses: actions/checkout@v3 - - name: Unshallow clone for tags - run: git fetch --prune --unshallow --tags - - name: Install Go - uses: actions/setup-go@v4 - with: - cache-dependency-path: | - sdk/go.sum - go-version: 1.21.x - - name: Install pulumictl - uses: jaxxstorm/action-install-gh-release@v1.5.0 - with: - repo: pulumi/pulumictl - - name: Install Pulumi CLI - uses: pulumi/action-install-pulumi-cli@v2 - - name: Setup DotNet - uses: actions/setup-dotnet@v1 - with: - dotnet-version: ${{ env.DOTNETVERSION }} - - name: Setup Node - uses: actions/setup-node@v2 - with: - node-version: ${{ env.NODEVERSION }} - registry-url: https://registry.npmjs.org - - name: Setup Python - uses: actions/setup-python@v2 - with: - python-version: ${{ env.PYTHONVERSION }} - - name: Update pulumi-terraform-bridge - run: cd provider && go mod edit -require - github.com/pulumi/pulumi-terraform-bridge/v3@v${{ - github.event.inputs.bridge_version }} && go mod tidy - - name: Update Pulumi SDK (provider/go.mod) - run: cd provider && go mod edit -require github.com/pulumi/pulumi/sdk/v3@v${{ - github.event.inputs.sdk_version }} && go mod tidy - - name: Update Pulumi SDK (sdk/go.mod) - run: cd sdk && go mod edit -require github.com/pulumi/pulumi/sdk/v3@v${{ - github.event.inputs.sdk_version }} && go mod tidy - - run: make tfgen - - run: make build_sdks - - id: create-pr - name: Create PR - uses: peter-evans/create-pull-request@v3.12.0 - with: - author: pulumi-bot - base: master - body: This pull request was generated automatically by the update-bridge - workflow in this repository. - branch: pulumi-bot/bridge-v${{ github.event.inputs.bridge_version }}-${{ - github.run_id}} - commit-message: Update pulumi-terraform-bridge to v${{ - github.event.inputs.bridge_version }} - committer: pulumi-bot - labels: impact/no-changelog-required - team-reviewers: platform-integrations - title: Update pulumi-terraform-bridge to v${{ github.event.inputs.bridge_version }} - token: ${{ secrets.PULUMI_BOT_TOKEN }} - - if: steps.create-pr.outputs.pull-request-operation == 'created' && - github.event.inputs.automerge == 'true' - run: gh pr merge --auto --squash ${{ steps.create-pr.outputs.pull-request-number }} -name: Update pulumi-terraform-bridge -on: - workflow_dispatch: - inputs: - automerge: - default: false - description: Mark created PR for auto-merging? - required: true - type: boolean - bridge_version: - description: The version of pulumi/pulumi-terraform-bridge to update to. Do not - include the 'v' prefix. Must be major version 3. - required: true - type: string - sdk_version: - description: The version of pulumi/pulumi/sdk to update to. Do not include the - 'v' prefix. Must be major version 3. - required: true - type: string diff --git a/.github/workflows/upgrade-provider.yml b/.github/workflows/upgrade-provider.yml index 423bc361..a820365e 100644 --- a/.github/workflows/upgrade-provider.yml +++ b/.github/workflows/upgrade-provider.yml @@ -5,7 +5,7 @@ env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} jobs: upgrade_provider: - if: ${{ contains(github.event.issue.title, 'Upgrade terraform-provider-') }} + if: ${{ contains(github.event.issue.title, 'Upgrade terraform-provider-') || github.event_name == 'workflow_dispatch' }} name: upgrade-provider runs-on: ubuntu-latest steps: diff --git a/Makefile b/Makefile index d27be6ad..49c8c1d2 100644 --- a/Makefile +++ b/Makefile @@ -12,6 +12,7 @@ JAVA_GEN := pulumi-java-gen JAVA_GEN_VERSION := v0.5.4 TESTPARALLELISM := 10 WORKING_DIR := $(shell pwd) +PULUMI_CONVERT := 0 development: install_plugins provider build_sdks install_sdks @@ -93,9 +94,8 @@ install_dotnet_sdk: install_nodejs_sdk: yarn link --cwd $(WORKING_DIR)/sdk/nodejs/bin -install_plugins: - [ -x "$(shell command -v pulumi 2>/dev/null)" ] || curl -fsSL https://get.pulumi.com | sh - pulumi plugin install resource random 4.2.0 +install_plugins: .pulumi/bin/pulumi + .pulumi/bin/pulumi plugin install resource random 4.2.0 lint_provider: provider cd provider && golangci-lint run -c ../.golangci.yml @@ -108,7 +108,7 @@ test: tfgen: install_plugins upstream (cd provider && go build $(PULUMI_PROVIDER_BUILD_PARALLELISM) -o $(WORKING_DIR)/bin/$(TFGEN) -ldflags "-X $(PROJECT)/$(VERSION_PATH)=$(VERSION)" $(PROJECT)/$(PROVIDER_PATH)/cmd/$(TFGEN)) - $(WORKING_DIR)/bin/$(TFGEN) schema --out provider/cmd/$(PROVIDER) + PATH=${PWD}/.pulumi/bin:$$PATH PULUMI_CONVERT=$(PULUMI_CONVERT) $(WORKING_DIR)/bin/$(TFGEN) schema --out provider/cmd/$(PROVIDER) (cd provider && VERSION=$(VERSION) go generate cmd/$(PROVIDER)/main.go) upstream: @@ -125,4 +125,26 @@ upstream.rebase: bin/pulumi-java-gen: $(shell pulumictl download-binary -n pulumi-language-java -v $(JAVA_GEN_VERSION) -r pulumi/pulumi-java) -.PHONY: development build build_sdks install_go_sdk install_java_sdk install_python_sdk install_sdks only_build build_dotnet build_go build_java build_nodejs build_python clean cleanup help install_dotnet_sdk install_nodejs_sdk install_plugins lint_provider provider test tfgen upstream upstream.finalize upstream.rebase +# To make an immediately observable change to .ci-mgmt.yaml: +# +# - Edit .ci-mgmt.yaml +# - Run make ci-mgmt to apply the change locally. +# +ci-mgmt: .ci-mgmt.yaml + rm .github/workflows/*.yml # Copied from update-workflows.yml + go run github.com/pulumi/ci-mgmt/provider-ci@master generate \ + --name pulumi/pulumi-$(PACK) \ + --out . \ + --template bridged-provider \ + --config $< + +.pulumi/bin/pulumi: HOME := $(WORKING_DIR) +.pulumi/bin/pulumi: .pulumi/version + curl -fsSL https://get.pulumi.com | sh -s -- --version $(cat .pulumi/version) + +# Compute the version of Pulumi to use by inspecting the Go dependencies of the provider. +.pulumi/version: + @mkdir -p .pulumi + @cd provider && go list -f "{{slice .Version 1}}" -m github.com/pulumi/pulumi/pkg/v3 | tee ../$@ + +.PHONY: development build build_sdks install_go_sdk install_java_sdk install_python_sdk install_sdks only_build build_dotnet build_go build_java build_nodejs build_python clean cleanup help install_dotnet_sdk install_nodejs_sdk install_plugins lint_provider provider test tfgen upstream upstream.finalize upstream.rebase ci-mgmt