Skip to content

Commit

Permalink
Do not hardcode total provider lists
Browse files Browse the repository at this point in the history
  • Loading branch information
t0yv0 committed Oct 25, 2023
1 parent 92e5e18 commit 21abd86
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 100 deletions.
67 changes: 17 additions & 50 deletions .github/workflows/update-providers-auto.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,15 @@ env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

jobs:
generate-providers-list:
runs-on: ubuntu-latest
steps:
- id: get-providers
run: echo "providers=$(jq . <(curl https://raw.githubusercontent.com/pulumi/ci-mgmt/master/provider-ci/providers.json) --compact-output)" >> "$GITHUB_OUTPUT"
working-directory: provider-ci
outputs:
providers: ${{ steps.get-providers.outputs.providers }}

build:
runs-on: ubuntu-latest
name: Upgrade ${{ matrix.provider }} to pulumi-terraform-bridge to the latest version automatically
Expand All @@ -18,62 +27,20 @@ jobs:
uses: peter-evans/repository-dispatch@v2
with:
token: ${{ secrets.PULUMI_BOT_TOKEN }}
repository: pulumi/${{ matrix.provider }}
repository: pulumi/pulumi-${{ matrix.provider }}
event-type: upgrade-bridge
# Not specifying target-bridge-version in the payload will make it upgrade to the latest.
client-payload: |-
{
"pr-reviewers": "t0yv0",
"automerge": true
}
needs: generate-providers-list
strategy:
fail-fast: false
# GitHub recommends only issuing 1 API request per second, and never
# concurrently. For more information, see:
# https://docs.github.com/en/rest/guides/best-practices-for-integrators#dealing-with-secondary-rate-limits
max-parallel: 1
matrix:
provider:
- pulumi-aiven
- pulumi-akamai
- pulumi-alicloud
- pulumi-auth0
- pulumi-aws
- pulumi-azure
- pulumi-azuread
- pulumi-azuredevops
- pulumi-civo
- pulumi-cloudamqp
- pulumi-cloudflare
- pulumi-cloudinit
- pulumi-consul
- pulumi-datadog
- pulumi-digitalocean
- pulumi-dnsimple
- pulumi-docker
- pulumi-f5bigip
- pulumi-fastly
- pulumi-gcp
- pulumi-github
- pulumi-gitlab
- pulumi-hcloud
- pulumi-kafka
- pulumi-keycloak
- pulumi-kong
- pulumi-linode
- pulumi-mailgun
- pulumi-mongodbatlas
- pulumi-mysql
- pulumi-newrelic
- pulumi-ns1
- pulumi-okta
- pulumi-openstack
- pulumi-pagerduty
- pulumi-postgresql
- pulumi-rabbitmq
- pulumi-rancher2
- pulumi-random
- pulumi-signalfx
- pulumi-splunk
- pulumi-spotinst
- pulumi-tls
- pulumi-vault
- pulumi-venafi
- pulumi-vsphere
- pulumi-wavefront
provider: ${{ fromJson(needs.generate-providers-list.outputs.providers ) }}
fail-fast: false
68 changes: 18 additions & 50 deletions .github/workflows/update-providers.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,16 @@ env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

jobs:

generate-providers-list:
runs-on: ubuntu-latest
steps:
- id: get-providers
run: echo "providers=$(jq . <(curl https://raw.githubusercontent.com/pulumi/ci-mgmt/master/provider-ci/providers.json) --compact-output)" >> "$GITHUB_OUTPUT"
working-directory: provider-ci
outputs:
providers: ${{ steps.get-providers.outputs.providers }}

build:
runs-on: ubuntu-latest
name: Upgrade ${{ matrix.provider }} to pulumi-terraform-bridge ${{ github.event.inputs.bridgeVersion }}
Expand All @@ -23,62 +33,20 @@ jobs:
uses: peter-evans/repository-dispatch@v2
with:
token: ${{ secrets.PULUMI_BOT_TOKEN }}
repository: pulumi/${{ matrix.provider }}
repository: pulumi/pulumi-${{ matrix.provider }}
event-type: upgrade-bridge
client-payload: |-
{
"target-bridge-version": ${{ toJSON(github.event.inputs.bridgeVersion) }},
"pr-reviewers": ${{ toJSON( github.triggering_actor || 't0yv0' ) }},
"automerge": ${{ toJSON(github.event.inputs.automerge) }}
}
needs: generate-providers-list
strategy:
fail-fast: false
# GitHub recommends only issuing 1 API request per second, and never
# concurrently. For more information, see:
# https://docs.github.com/en/rest/guides/best-practices-for-integrators#dealing-with-secondary-rate-limits
max-parallel: 1
matrix:
provider:
- pulumi-aiven
- pulumi-akamai
- pulumi-alicloud
- pulumi-auth0
- pulumi-aws
- pulumi-azure
- pulumi-azuread
- pulumi-azuredevops
- pulumi-civo
- pulumi-cloudamqp
- pulumi-cloudflare
- pulumi-cloudinit
- pulumi-consul
- pulumi-datadog
- pulumi-digitalocean
- pulumi-dnsimple
- pulumi-docker
- pulumi-f5bigip
- pulumi-fastly
- pulumi-gcp
- pulumi-github
- pulumi-gitlab
- pulumi-hcloud
- pulumi-kafka
- pulumi-keycloak
- pulumi-kong
- pulumi-linode
- pulumi-mailgun
- pulumi-mongodbatlas
- pulumi-mysql
- pulumi-newrelic
- pulumi-ns1
- pulumi-okta
- pulumi-openstack
- pulumi-pagerduty
- pulumi-postgresql
- pulumi-rabbitmq
- pulumi-rancher2
- pulumi-random
- pulumi-signalfx
- pulumi-splunk
- pulumi-spotinst
- pulumi-tls
- pulumi-vault
- pulumi-venafi
- pulumi-vsphere
- pulumi-wavefront
provider: ${{ fromJson(needs.generate-providers-list.outputs.providers ) }}
fail-fast: false

0 comments on commit 21abd86

Please sign in to comment.