Skip to content

Commit

Permalink
renamed project
Browse files Browse the repository at this point in the history
  • Loading branch information
dominik-przybyl-wttech committed Feb 22, 2024
1 parent 0d3b0f7 commit 3cb64e6
Show file tree
Hide file tree
Showing 64 changed files with 1,196 additions and 2,288 deletions.
20 changes: 12 additions & 8 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
PROJECT_NAME := Pulumi Xyz Resource Provider
PROJECT_NAME := Pulumi AEM Resource Provider

PACK := xyz
PACK := aem
MOD := compose
PACKDIR := sdk
PROJECT := github.com/pulumi/pulumi-xyz
NODE_MODULE_NAME := @pulumi/xyz
NUGET_PKG_NAME := Pulumi.Xyz
PROJECT := github.com/wttech/pulumi-provider-aem
NODE_MODULE_NAME := @pulumi/aem
NUGET_PKG_NAME := Pulumi.Aem

PROVIDER := pulumi-resource-${PACK}
VERSION ?= $(shell pulumictl get version)
Expand All @@ -26,7 +27,7 @@ provider::
(cd provider && go build -o $(WORKING_DIR)/bin/${PROVIDER} -ldflags "-X ${PROJECT}/${VERSION_PATH}=${VERSION}" $(PROJECT)/${PROVIDER_PATH}/cmd/$(PROVIDER))

provider_debug::
(cd provider && go build -o $(WORKING_DIR)/bin/${PROVIDER} -gcflags="all=-N -l" -ldflags "-X ${PROJECT}/${VERSION_PATH}=${VERSION}" $(PROJECT)/${PROVIDER_PATH}/cmd/$(PROVIDER))
(cd provider && go build -o $(WORKING_DIR)/bin/${PROVIDER} -gcflags "all=-N -l" -ldflags "-X ${PROJECT}/${VERSION_PATH}=${VERSION}" $(PROJECT)/${PROVIDER_PATH}/cmd/$(PROVIDER))

test_provider::
cd tests && go test -short -v -count=1 -cover -timeout 2h -parallel ${TESTPARALLELISM} ./...
Expand All @@ -42,6 +43,9 @@ dotnet_sdk::
go_sdk:: $(WORKING_DIR)/bin/$(PROVIDER)
rm -rf sdk/go
pulumi package gen-sdk $(WORKING_DIR)/bin/$(PROVIDER) --language go
sed -i '' -e 's/"internal"/"github.com\/wttech\/pulumi-provider-aem\/sdk\/go\/aem\/internal"/g' sdk/go/$(PACK)/*.go
sed -i '' -e 's/"internal"/"github.com\/wttech\/pulumi-provider-aem\/sdk\/go\/aem\/internal"/g' sdk/go/$(PACK)/$(MOD)/*.go
sed -i '' -e 's/\/pulumi-aem\/sdk/\/pulumi-provider-aem\/sdk/g' sdk/go/$(PACK)/internal/*.go

nodejs_sdk:: VERSION := $(shell pulumictl get version --language javascript)
nodejs_sdk::
Expand Down Expand Up @@ -108,7 +112,7 @@ devcontainer::

.PHONY: build

build:: provider dotnet_sdk go_sdk nodejs_sdk python_sdk
build:: provider go_sdk nodejs_sdk

# Required for the codegen action that runs in pulumi/pulumi
only_build:: build
Expand All @@ -118,7 +122,7 @@ lint::
pushd $$DIR && golangci-lint run -c ../.golangci.yml --timeout 10m && popd ; \
done

install:: install_nodejs_sdk install_dotnet_sdk
install:: install_nodejs_sdk
cp $(WORKING_DIR)/bin/${PROVIDER} ${GOPATH}/bin

GO_TEST := go test -v -count=1 -cover -timeout 2h -parallel ${TESTPARALLELISM}
Expand Down
32 changes: 7 additions & 25 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# Pulumi Native Provider Boilerplate
# Pulumi AEM Compose Provider

This repository is a boilerplate showing how to create and locally test a native Pulumi provider.
This repository is showing how to create and locally test a native Pulumi provider.

## Authoring a Pulumi Native Provider

This boilerplate creates a working Pulumi-owned provider named `xyz`.
This creates a working Pulumi-owned provider named `aem`.
It implements a random number generator that you can [build and test out for yourself](#test-against-the-example) and then replace the Random code with code specific to your provider.


Expand All @@ -19,11 +19,9 @@ If you are not using VSCode, you will need to ensure the following tools are ins
* [NodeJS](https://nodejs.org/en/) 14.x. We recommend using [nvm](https://github.com/nvm-sh/nvm) to manage NodeJS installations.
* [Yarn](https://yarnpkg.com/)
* [TypeScript](https://www.typescriptlang.org/)
* [Python](https://www.python.org/downloads/) (called as `python3`). For recent versions of MacOS, the system-installed version is fine.
* [.NET](https://dotnet.microsoft.com/download)


### Build & test the boilerplate XYZ provider
### Build & test the AEM provider

1. Create a new Github CodeSpaces environment using this repository.
1. Open a terminal in the CodeSpaces environment.
Expand All @@ -32,22 +30,6 @@ If you are not using VSCode, you will need to ensure the following tools are ins
1. Run `make up` to run the example program in `examples/yaml`.
1. Run `make down` to tear down the example program.

### Creating a new provider repository

Pulumi offers this repository as a [GitHub template repository](https://docs.github.com/en/repositories/creating-and-managing-repositories/creating-a-repository-from-a-template) for convenience. From this repository:

1. Click "Use this template".
1. Set the following options:
* Owner: pulumi
* Repository name: pulumi-xyz-native (replace "xyz" with the name of your provider)
* Description: Pulumi provider for xyz
* Repository type: Public
1. Clone the generated repository.

From the templated repository:

1. Search-replace `xyz` with the name of your desired provider.

#### Build the provider and install the plugin

```bash
Expand All @@ -65,7 +47,7 @@ This will:

```bash
$ cd examples/simple
$ yarn link @pulumi/xyz
$ yarn link @pulumi/aem
$ yarn install
$ pulumi stack init test
$ pulumi up
Expand All @@ -78,9 +60,9 @@ Now that you have completed all of the above steps, you have a working provider
You now have:

1. A `provider/` folder containing the building and implementation logic
1. `cmd/pulumi-resource-xyz/main.go` - holds the provider's sample implementation logic.
1. `cmd/pulumi-resource-aem/main.go` - holds the provider's sample implementation logic.
2. `deployment-templates` - a set of files to help you around deployment and publication
3. `sdk` - holds the generated code libraries created by `pulumi-gen-xyz/main.go`
3. `sdk` - holds the generated code libraries created by `pulumi-gen-aem/main.go`
4. `examples` a folder of Pulumi programs to try locally and/or use in CI.
5. A `Makefile` and this `README`.

Expand Down
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 gen
builds:
- binary: pulumi-resource-xyz
- binary: pulumi-resource-aem
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/Version={{.Tag }}
main: ./cmd/pulumi-resource-xyz/
- -X github.com/wttech/pulumi-provider-aem/provider/Version={{.Tag }}
main: ./cmd/pulumi-resource-aem/
changelog:
skip: true
release:
Expand Down
2 changes: 1 addition & 1 deletion deployment-templates/README-DEPLOYMENT.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

`${{ secrets.MyTokenName }}`

1. Customize .goreleaser.yml for your provider, replacing any instances of 'xyz' with your provider's name, and paying special attention that the ldlflags are set to match your provider/go.mod exactly:
1. Customize .goreleaser.yml for your provider, replacing any instances of 'aem' with your provider's name, and paying special attention that the ldlflags are set to match your provider/go.mod exactly:

`-X github.com/pulumi/pulumi-aws/provider/v5/pkg/version.Version={{.Tag}}`

Expand Down
4 changes: 1 addition & 3 deletions deployment-templates/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ on:
- v*.*.*
- '!v*.*.*-**'
env:
PROVIDER: "YOUR PROVIDER NAME HERE eg: xyz"
PROVIDER: "YOUR PROVIDER NAME HERE eg: aem"
# THIS GITHUB_TOKEN IS A REQUIREMENT TO BE ABLE TO WRITE TO GH RELEASES
GITHUB_TOKEN: ${{ YOUR GITHUB TOKEN HERE }}
# IF YOU NEED TO PUBLISH A NPM PACKAGE THEN ENSURE A NPM_TOKEN SECRET IS SET
Expand Down Expand Up @@ -134,8 +134,6 @@ jobs:
- 1.18.x
language:
- nodejs
- python
- dotnet
- go
nodeversion:
- 14.x
Expand Down
Loading

0 comments on commit 3cb64e6

Please sign in to comment.