Skip to content

Commit

Permalink
Merge pull request #1 from piclemx/generate-provider
Browse files Browse the repository at this point in the history
Generate provider
  • Loading branch information
piclemx authored Jun 20, 2023
2 parents 13f24d2 + 5abbd91 commit cba22e8
Show file tree
Hide file tree
Showing 641 changed files with 108,950 additions and 81 deletions.
5 changes: 5 additions & 0 deletions .tool-versions
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
golang 1.18
nodejs 14.21.3
pulumi 3.51.1
python 3.11.2
dotnet 7.0.302
10 changes: 5 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
PROJECT_NAME := xyz Package
PROJECT_NAME := nobl9 Package

SHELL := /bin/bash
PACK := xyz
ORG := pulumi
PACK := nobl9
ORG := piclemx
PROJECT := github.com/${ORG}/pulumi-${PACK}
NODE_MODULE_NAME := @pulumi/${PACK}
TF_NAME := ${PACK}
Expand All @@ -29,13 +29,13 @@ prepare::
mv "provider/cmd/pulumi-resource-x${EMPTY_TO_AVOID_SED}yz" provider/cmd/pulumi-resource-${NAME}

if [[ "${OS}" != "Darwin" ]]; then \
sed -i 's,github.com/pulumi/pulumi-xyz,${REPOSITORY},g' provider/go.mod; \
sed -i 's,github.com/piclemx/pulumi-nobl9,${REPOSITORY},g' provider/go.mod; \
find ./ ! -path './.git/*' -type f -exec sed -i 's/[x]yz/${NAME}/g' {} \; &> /dev/null; \
fi

# In MacOS the -i parameter needs an empty string to execute in place.
if [[ "${OS}" == "Darwin" ]]; then \
sed -i '' 's,github.com/pulumi/pulumi-xyz,${REPOSITORY},g' provider/go.mod; \
sed -i '' 's,github.com/piclemx/pulumi-nobl9,${REPOSITORY},g' provider/go.mod; \
find ./ ! -path './.git/*' -type f -exec sed -i '' 's/[x]yz/${NAME}/g' {} \; &> /dev/null; \
fi

Expand Down
16 changes: 8 additions & 8 deletions README-PROVIDER.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Foo Resource Provider
# Nobl9 Resource Provider

The Foo Resource Provider lets you manage [Foo](http://example.com) resources.
The Nobl9 Resource Provider lets you manage [Nobl9](https://www.nobl9.com/) resources.

## Installing

Expand All @@ -11,37 +11,37 @@ This package is available for several languages/platforms:
To use from JavaScript or TypeScript in Node.js, install using either `npm`:

```bash
npm install @pulumi/foo
npm install @piclemx/pulumi-nobl9/
```

or `yarn`:

```bash
yarn add @pulumi/foo
yarn add @piclemx/pulumi-nobl9
```

### Python

To use from Python, install using `pip`:

```bash
pip install pulumi_foo
pip install pulumi_nobl9
```

### Go

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

```bash
go get github.com/pulumi/pulumi-foo/sdk/go/...
go get github.com/piclemx/pulumi-nobl9/sdk/go/...
```

### .NET

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

```bash
dotnet add package Pulumi.Foo
dotnet add package Pulumi.Nobl9
```

## Configuration
Expand All @@ -53,4 +53,4 @@ The following configuration points are available for the `foo` provider:

## Reference

For detailed reference documentation, please visit [the Pulumi registry](https://www.pulumi.com/registry/packages/foo/api-docs/).
For detailed reference documentation, please visit [the Pulumi registry](https://www.pulumi.com/registry/packages/nobl9/api-docs/).
36 changes: 18 additions & 18 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ From the templated repository:
This will do the following:
- rename folders in `provider/cmd` to `pulumi-resource-foo` and `pulumi-tfgen-foo`
- replace dependencies in `provider/go.mod` to reflect your repository name
- find and replace all instances of the boilerplate `xyz` with the `NAME` of your provider.
- find and replace all instances of the boilerplate `nobl9` with the `NAME` of your provider.

Note for third-party providers:
- Make sure to set the correct GitHub organization/username in all files referencing your provider as a dependency:
Expand Down Expand Up @@ -225,7 +225,7 @@ The `make tfgen` target will take the file `schema.json` and serialize it to a b
In this section, we will create a Pulumi program in TypeScript that utilizes the provider we created to ensure everything is working properly.
1. Create an account with the provider's service and generate any necessary credentials, e.g. API keys.
- Email: bot@pulumi.com
- Email: <bot@pulumi.com>
- Password: (Create a random password in 1Password with the maximum length and complexity allowed by the provider.)
- Ensure all secrets (passwords, generated API keys) are stored in Pulumi's 1Password vault.
Expand Down Expand Up @@ -359,7 +359,7 @@ before:
hooks:
- make tfgen
builds:
- binary: pulumi-resource-xyz
- binary: pulumi-resource-nobl9
dir: provider
goarch:
- amd64
Expand All @@ -370,8 +370,8 @@ builds:
- linux
ignore: []
ldflags:
- -X github.com/pulumi/pulumi-xyz/provider/pkg/version.Version={{.Tag}}
main: ./cmd/pulumi-resource-xyz/
- -X github.com/piclemx/pulumi-nobl9/provider/pkg/version.Version={{.Tag}}
main: ./cmd/pulumi-resource-nobl9/
sort: asc
use: git
release:
Expand All @@ -396,18 +396,18 @@ dist
├── artifacts.json
├── config.yaml
├── metadata.json
├── pulumi-xyz_darwin_amd64_v1
│ └── pulumi-resource-xyz
├── pulumi-xyz_darwin_arm64
│ └── pulumi-resource-xyz
├── pulumi-xyz_linux_amd64_v1
│ └── pulumi-resource-xyz
├── pulumi-xyz_linux_arm64
│ └── pulumi-resource-xyz
├── pulumi-xyz_windows_amd64_v1
│ └── pulumi-resource-xyz.exe
└── pulumi-xyz_windows_arm64
└── pulumi-resource-xyz.exe
├── pulumi-nobl9_darwin_amd64_v1
│ └── pulumi-resource-nobl9
├── pulumi-nobl9_darwin_arm64
│ └── pulumi-resource-nobl9
├── pulumi-nobl9_linux_amd64_v1
│ └── pulumi-resource-nobl9
├── pulumi-nobl9_linux_arm64
│ └── pulumi-resource-nobl9
├── pulumi-nobl9_windows_amd64_v1
│ └── pulumi-resource-nobl9.exe
└── pulumi-nobl9_windows_arm64
└── pulumi-resource-nobl9.exe
```
Any of the provider binaries can be used to target the correct machine architecture
Expand Down Expand Up @@ -455,4 +455,4 @@ EOF
cd provider && go mod tidy
```
<!-- markdownlint-enable MD010 -->
<!-- markdownlint-enable MD010 -->
6 changes: 3 additions & 3 deletions deployment-templates/.goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ before:
hooks:
- make tfgen
builds:
- binary: pulumi-resource-xyz
- binary: pulumi-resource-nobl9
dir: provider
env:
- CGO_ENABLED=0
Expand All @@ -18,8 +18,8 @@ builds:
- linux
ldflags:
# The line below MUST align with the module in current provider/go.mod
- -X github.com/your-org-name/pulumi-xyz/provider/pkg/version.Version={{.Tag }}
main: ./cmd/pulumi-resource-xyz/
- -X github.com/your-org-name/pulumi-nobl9/provider/pkg/version.Version={{.Tag }}
main: ./cmd/pulumi-resource-nobl9/
changelog:
skip: true
release:
Expand Down
4 changes: 3 additions & 1 deletion examples/go.mod
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
module github.com/pulumi/pulumi-xyz/examples
module github.com/piclemx/pulumi-nobl9/examples

go 1.16

require github.com/pulumi/pulumi/pkg/v3 v3.64.0
Loading

0 comments on commit cba22e8

Please sign in to comment.