Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: 1) docs typo 2) put back reusable workflow for upgrading provider #7

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
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
49 changes: 26 additions & 23 deletions .github/workflows/main.yml → .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,23 +1,26 @@
name: main

on:
push:
workflow_dispatch:

jobs:
prerequisites:
permissions:
pull-requests: write
uses: pulumiverse/infra/.github/workflows/[email protected]
with:
provider: cpln
goversion: 1.21.x
build:
needs: prerequisites
uses: pulumiverse/infra/.github/workflows/[email protected]
with:
provider: cpln
goversion: 1.21.x
dotnetversion: 6.0.300
nodeversion: 20.x
pythonversion: 3.9
name: build

on:
push:
branches-ignore:
# release workflow will build main anyway. No need to do it twice.
- 'main'
workflow_dispatch:

jobs:
prerequisites:
permissions:
pull-requests: write
uses: pulumiverse/infra/.github/workflows/[email protected]
with:
provider: cpln
goversion: 1.21.x
build:
needs: prerequisites
uses: pulumiverse/infra/.github/workflows/[email protected]
with:
provider: cpln
goversion: 1.21.x
dotnetversion: 6.0.300
nodeversion: 20.x
pythonversion: 3.9
44 changes: 5 additions & 39 deletions .github/workflows/upgrade-provider.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,6 @@ on:
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
jobs:
# TODO: Switch to shared CI like here
# https://github.com/pulumiverse/pulumi-vercel/blob/main/.github/workflows/upgrade-provider.yml
# after this issue is fixed
# https://github.com/pulumi/upgrade-provider/issues/179
# or when have time to fix failing go mod tidy in "all" mode.
upgrade_provider:
name: upgrade-provider
runs-on: ubuntu-latest
Expand All @@ -21,38 +16,9 @@ jobs:
pull-requests: write
issues: write
steps:
- name: Install Go
uses: actions/setup-go@v3
- name: Call upgrade provider action
uses: pulumi/pulumi-upgrade-provider-action@main
with:
go-version: 1.21.x
- name: Install pulumictl
uses: jaxxstorm/[email protected]
with:
repo: pulumi/pulumictl
- name: Install Pulumi CLI
uses: pulumi/actions@v4
- name: Checkout repo
uses: actions/checkout@v3
with:
ref: ${{ github.ref_name }}

- name: Unshallow clone for tags
run: git fetch --prune --unshallow --tags
shell: bash
- name: Install upgrade-provider
run: go install github.com/pulumi/upgrade-provider@176a45cf2471d5fccd6235c385ba1ec17b74a37f
shell: bash
- name: Setup Gradle
uses: gradle/gradle-build-action@v2
with:
gradle-version: "7.6"
- name: "Set up git identity: name"
run: git config --global user.name 'vavsab'
shell: bash
- name: Run upgrade-provider
run: |
upgrade-provider "$REPO" --kind="provider" --pr-reviewers="vavsab,jvassev,emaildanwilson,MajidAbuRmila"
shell: bash
env:
GH_TOKEN: ${{ env.GH_TOKEN }}
REPO: ${{ github.repository }}
# Upgrading all libs increases the chance of the build to fail.
# So, we upgrade only provider to reduce the number of human interventions.
kind: provider
3 changes: 1 addition & 2 deletions .upgrade-config.yml
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
upstream-provider-name: terraform-provider-cpln
pr-assign: vavsab
upstream-provider-name: terraform-provider-cpln
118 changes: 59 additions & 59 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,59 +1,59 @@
# cpln Resource Provider

The cpln Resource Provider lets you manage [Control Plane](https://controlplane.com/) resources.

## Installing

This package is available for several languages/platforms:

### Node.js (JavaScript/TypeScript)

To use from JavaScript or TypeScript in Node.js, install using either `npm`:

```bash
npm install @pulumiverse/cpln
```

or `yarn`:

```bash
yarn add @pulumiverse/cpln
```

### Python

To use from Python, install using `pip`:

```bash
pip install pulumi_cpln
```

### Go

To use from Go, use `go get` to grab the latest version of the library:

```bash
go get github.com/pulumiverse/pulumi-cpln/sdk/go/...
```

### .NET

To use from .NET, install using `dotnet add package`:

```bash
dotnet add package Pulumiverse.cpln
```

## Configuration

The following configuration points are available for the `cpln` provider:

- `cpln:org` - The Control Plane org that this provider will perform actions against
- `cpln:endpoint` - The Control Plane Data Service API endpoint
- `cpln:profile` - The user/service account profile that this provider will use to authenticate to the data service
- `cpln:token` - A generated token that can be used to authenticate to the data service API
- `cpln:refreshToken` - A generated token that can be used to authenticate to the data service API

## Reference

For detailed reference documentation, please visit [the Pulumi registry](https://www.pulumi.com/registry/packages/cpln/api-docs/).
# Control Plane (cpln) Resource Provider
The Control Plane Resource Provider lets you manage [Control Plane](https://controlplane.com/) resources.
## Installing
This package is available for several languages/platforms:
### Node.js (JavaScript/TypeScript)
To use from JavaScript or TypeScript in Node.js, install using either `npm`:
```bash
npm install @pulumiverse/cpln
```
or `yarn`:
```bash
yarn add @pulumiverse/cpln
```
### Python
To use from Python, install using `pip`:
```bash
pip install pulumiverse-cpln
```
### Go
To use from Go, use `go get` to grab the latest version of the library:
```bash
go get github.com/pulumiverse/pulumi-cpln/sdk/go/...
```
### .NET
To use from .NET, install using `dotnet add package`:
```bash
dotnet add package Pulumiverse.cpln
```
## Configuration
The following configuration points are available for the `cpln` provider:
- `cpln:org` - The Control Plane org that this provider will perform actions against
- `cpln:endpoint` - The Control Plane Data Service API endpoint
- `cpln:profile` - The user/service account profile that this provider will use to authenticate to the data service
- `cpln:token` - A generated token that can be used to authenticate to the data service API
- `cpln:refreshToken` - A generated token that can be used to authenticate to the data service API
## Reference
For detailed reference documentation, please visit [the Pulumi registry](https://www.pulumi.com/registry/packages/cpln/api-docs/).
45 changes: 28 additions & 17 deletions docs/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,43 +14,51 @@ The Control Plane (cpln) Pulumi provider enables the scaffolding of any Control
```typescript
import * as cpln from "@pulumiverse/cpln";

const location = new cpln.Location("example", {
name: "aws-us-west-2"
const group = new cpln.Group("example", {
description: "example"
});

export const groupId = group.id;
```

{{% /choosable %}}
{{% choosable language python %}}

```python
import pulumi
import pulumiverse_cpln as cpln

db = cpln.Location("example",
name="aws-us-west-2"
group = cpln.Group("example",
description="example"
)

pulumi.export("group.id", group.id)
```

{{% /choosable %}}
{{% choosable language go %}}

```go
package main

import (
"fmt"
cpln "github.com/pulumiverse/pulumi-cpln/sdk/go/cpln"

"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
cpln "github.com/pulumiverse/pulumi-cpln/sdk/go/cpln"
)

func main() {
pulumi.Run(func(ctx *pulumi.Context) error {

location, err := cpln.NewLocation(ctx, "example", &cpln.LocationArgs{
Name: pulumi.String("aws-us-west-2"),
group, err := cpln.NewGroup(ctx, "example", &cpln.GroupArgs{
Description: pulumi.String("example"),
})
if err != nil {
return fmt.Errorf("error creating location: %v", err)
return fmt.Errorf("error creating a group: %v", err)
}

ctx.Export("location.enabled", location.enabled)
ctx.Export("group.id", group.ID())

return nil
})
Expand All @@ -61,18 +69,21 @@ func main() {
{{% choosable language csharp %}}

```csharp
using System.Collections.Generic;
using Pulumi;
using Pulumiverse.cpln;
using Pulumiverse.Cpln;

class cpln : Stack
return await Deployment.RunAsync(() =>
{
public cpln()
var group = new Group("example", new GroupArgs{
Description = "example"
});

return new Dictionary<string, object?>
{
var location = new Location("example", new LocationArgs{
Name: "example"
});
}
}
["group.id"] = group.Id
};
});
```

{{% /choosable %}}
Expand Down
2 changes: 1 addition & 1 deletion docs/installation-configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ layout: package
The Pulumi Control Plane (cpln) provider is available as a package in all Pulumi languages:

* JavaScript/TypeScript: [`@pulumiserve/cpln`](https://www.npmjs.com/package/@pulumiverse/cpln)
* Python: [`pulumiverse_cpln`](https://pypi.org/project/pulumiverse-cpln/)
* Python: [`pulumiverse-cpln`](https://pypi.org/project/pulumiverse-cpln/)
* Go: [`github.com/pulumiverse/pulumi-cpln/sdk/go/cpln`](https://pkg.go.dev/github.com/pulumiverse/pulumi-cpln/sdk)
* .NET: [`Pulumiverse.cpln`](https://www.nuget.org/packages/Pulumiverse.cpln)

Expand Down
Loading
Loading