Skip to content
Merged
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
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
25 changes: 25 additions & 0 deletions .ci-mgmt.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
template: external-bridged-provider
provider: zitadel
organization: pulumiverse
major-version: 0
providerDefaultBranch: main
upstreamProviderOrg: zitadel
publishRegistry: false
plugins:
- name: terraform
version: "1.0.19"
kind: converter
- name: random
version: "4.16.7"
languages:
- dotnet
- go
- nodejs
- python
publish:
sdk: "all,!java"
cdn: false
# license:
# ignore:
# Don't check for the license of the local shim package
pulumiConvert: 1
71 changes: 8 additions & 63 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,67 +1,12 @@
ARG UBUNTU_VERSION=latest
FROM ubuntu:${UBUNTU_VERSION}
FROM jetpackio/devbox:latest

# Update apt-get and install various needed utilities
RUN apt-get update && \
apt-get install -y curl && \
apt-get install -y wget && \
apt-get install -y xz-utils && \
apt-get install -y make && \
apt-get install -y gcc && \
apt-get install -y git
# Installing your devbox project
WORKDIR /code
COPY devbox.json devbox.json
COPY devbox.lock devbox.lock
RUN sudo chown -R "${DEVBOX_USER}:${DEVBOX_USER}" /code

# Install bridged provider prerequisites
# See README.md

# Install go
ARG GO_VERSION=1.21.1
RUN rm -rf /usr/local/go && \
wget -O ${GO_VERSION}.tar.gz https://golang.org/dl/go${GO_VERSION}.linux-amd64.tar.gz && \
tar -C /usr/local -xzf ${GO_VERSION}.tar.gz && \
rm ${GO_VERSION}.tar.gz
RUN devbox run -- echo "Installed Packages."

ENV GOPATH=/root/go
ENV PATH=$PATH:/usr/local/go/bin

# Install go linter
RUN mkdir -p $GOPATH/bin && \
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $GOPATH/bin v1.46.2

ENV PATH=$PATH:$GOPATH/bin

# Install pulumictl
ARG PULUMICTL_VERSION=v0.0.32
RUN rm -rf /usr/local/bin/pulumictl && \
wget -O pulumictl.${PULUMICTL_VERSION}.tar.gz https://github.com/pulumi/pulumictl/releases/download/${PULUMICTL_VERSION}/pulumictl-${PULUMICTL_VERSION}-linux-amd64.tar.gz && \
tar -C /usr/local/bin -xzf pulumictl.${PULUMICTL_VERSION}.tar.gz

# Install nodejs
ARG NODEJS_VERSION=v20.11.1
ARG NODEJS_PKG=node-${NODEJS_VERSION}-linux-x64
ARG NODEJS_TARBALL=${NODEJS_PKG}.tar.xz
RUN rm -rf /usr/local/node && \
wget -O ${NODEJS_TARBALL} https://nodejs.org/dist/${NODEJS_VERSION}/${NODEJS_TARBALL} && \
tar -C /usr/local -xf ${NODEJS_TARBALL} && \
mv /usr/local/${NODEJS_PKG} /usr/local/node

ENV PATH=$PATH:/usr/local/node/bin

# Install yarn
RUN npm install --global yarn

# Install python and related items
RUN apt-get install -y python3 && \
apt-get install -y python3-setuptools

# Install .NET
# https://stackoverflow.com/questions/73753672/a-fatal-error-occurred-the-folder-usr-share-dotnet-host-fxr-does-not-exist
RUN apt-get remove dotnet* && \
apt-get remove aspnetcore* && \
apt-get remove netstandard&

RUN apt-get update && \
apt-get install dotnet-sdk-6.0 -y

# Install Pulumi
RUN curl -fsSL https://get.pulumi.com | sh
ENV PATH=$PATH:/root/.pulumi/bin
RUN devbox shellenv --init-hook >> ~/.profile
18 changes: 13 additions & 5 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,16 @@
// For format details, see https://aka.ms/devcontainer.json. For config options, see the README at:
// https://github.com/microsoft/vscode-dev-containers/tree/v0.202.3/containers/hugo
{
"name": "TFProvider",
"name": "Devbox Remote Container",
"build": {
"dockerfile": "Dockerfile"
}
"dockerfile": "./Dockerfile",
"context": ".."
},
"customizations": {
"vscode": {
"settings": {},
"extensions": [
"jetpack-io.devbox"
]
}
},
"remoteUser": "devbox"
}
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
sdk/**/* linguist-generated=true
28 changes: 28 additions & 0 deletions .github/actions/download-prerequisites/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Download the code generator binary
description: Downloads the code generator binary to `bin/`.

runs:
using: "composite"
steps:
- name: Download the prerequisites bin
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8
with:
name: prerequisites-bin
path: bin

- name: Restore executable permissions
shell: bash
run: chmod +x $(< bin/executables.txt)

- name: Remove executables list
shell: bash
run: rm bin/executables.txt

- name: Download schema-embed.json
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8
with:
# Use a pattern to avoid failing if the artifact doesn't exist
pattern: schema-embed.*
# Avoid creating directories for each artifact
merge-multiple: true
path: provider/cmd/pulumi-resource-zitadel
23 changes: 23 additions & 0 deletions .github/actions/download-provider/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: Download the provider binary
description: Downloads the provider binary to `bin/`.

runs:
using: "composite"
steps:

- name: Download pulumi-resource-zitadel
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8
with:
pattern: pulumi-resource-zitadel-*-linux-amd64.tar.gz
path: ${{ github.workspace }}/bin
merge-multiple: true

- name: Untar pulumi-resource-zitadel
shell: bash
run: |
tar -zxf ${{ github.workspace }}/bin/*amd64.tar.gz -C ${{ github.workspace}}/bin

- name: Mark pulumi-resource-zitadel as executable
shell: bash
run: |
find ${{ github.workspace }} -name "pulumi-*-zitadel" -print -exec chmod +x {} \;
19 changes: 19 additions & 0 deletions .github/actions/download-sdk/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: Download SDK asset
description: Restores the SDK asset for a language.

inputs:
language:
required: true
description: One of nodejs, python, dotnet, go, java

runs:
using: "composite"
steps:
- name: Download ${{ inputs.language }} SDK
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8
with:
name: ${{ inputs.language }}-sdk.tar.gz
path: ${{ github.workspace}}/sdk/
- name: Uncompress SDK folder
shell: bash
run: tar -zxf ${{ github.workspace }}/sdk/${{ inputs.language }}.tar.gz -C ${{ github.workspace }}/sdk/${{ inputs.language }}
91 changes: 91 additions & 0 deletions .github/actions/setup-tools/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
name: Setup tools
description: Installs Go, Pulumi, pulumictl, schema-tools, Node.JS, Python, dotnet and Java.

inputs:
tools:
description: |
Comma separated list of tools to install. The default of "all" installs all tools. Available tools are:
go
pulumicli
pulumictl
schema-tools
nodejs
python
dotnet
java
default: all
cache-go:
description: |
Whether to enable the GitHub cache for Go. Appropriate for disabling in
smaller jobs that typically completely before the "real" job has an
opportunity to populate the cache.
default: "true"

runs:
using: "composite"
steps:
- name: Install Go
if: inputs.tools == 'all' || contains(inputs.tools, 'go')
uses: actions/setup-go@f111f3307d8850f501ac008e886eec1fd1932a34 # v5
with:
go-version: "1.21.x"
cache-dependency-path: |
provider/*.sum
upstream/*.sum
sdk/go/*.sum
sdk/*.sum
*.sum
# TODO(https://github.com/actions/setup-go/issues/316): Restore but don't save the cache.
cache: ${{ inputs.cache-go }}

- name: Install pulumictl
if: inputs.tools == 'all' || contains(inputs.tools, 'pulumictl')
uses: jaxxstorm/action-install-gh-release@cd6b2b78ad38bdd294341cda064ec0692b06215b # v1.14.0
with:
tag: v0.0.46
repo: pulumi/pulumictl

- name: Install Pulumi CLI
if: inputs.tools == 'all' || contains(inputs.tools, 'pulumicli')
uses: pulumi/actions@13b8b7177d6fb736766875dac9b78aab07bd785f # v6
with:
pulumi-version: "dev"

- name: Install Schema Tools
if: inputs.tools == 'all' || contains(inputs.tools, 'schema-tools')
uses: jaxxstorm/action-install-gh-release@cd6b2b78ad38bdd294341cda064ec0692b06215b # v1.14.0
with:
repo: pulumi/schema-tools

- name: Setup Node
if: inputs.tools == 'all' || contains(inputs.tools, 'nodejs')
uses: actions/setup-node@1d0ff469b7ec7b3cb9d8673fde0c81c44821de2a # v4
with:
node-version: 20.x
registry-url: https://registry.npmjs.org

- name: Setup DotNet
if: inputs.tools == 'all' || contains(inputs.tools, 'dotnet')
uses: actions/setup-dotnet@3951f0dfe7a07e2313ec93c75700083e2005cbab # v4.3.0
with:
dotnet-version: 6.0.x

- name: Setup Python
if: inputs.tools == 'all' || contains(inputs.tools, 'python')
uses: actions/setup-python@42375524e23c412d93fb67b49958b491fce71c38 # v5.4.0
with:
python-version: 3.11.8

- name: Setup Java
if: inputs.tools == 'all' || contains(inputs.tools, 'java')
uses: actions/setup-java@3a4f6e1af504cf6a31855fa899c6aa5355ba6c12 # v4.7.0
with:
cache: gradle
distribution: temurin
java-version: 11

- name: Setup Gradle
if: inputs.tools == 'all' || contains(inputs.tools, 'java')
uses: gradle/gradle-build-action@ac2d340dc04d9e1113182899e983b5400c17cda1 # v3
with:
gradle-version: 7.6
23 changes: 23 additions & 0 deletions .github/actions/upload-prerequisites/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: Upload SDK asset
description: Upload the SDK for a specific language as an asset for the workflow.

runs:
using: "composite"
steps:
- name: Capture executable permissions
shell: bash
run: find bin -type f -executable > bin/executables.txt

- name: Upload prerequisites bin
uses: actions/upload-artifact@65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08 # v4.6.0
with:
name: prerequisites-bin
path: bin/*
retention-days: 30

- name: Upload schema-embed.json
uses: actions/upload-artifact@65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08 # v4.6.0
with:
name: schema-embed.json
path: provider/cmd/pulumi-resource-zitadel/schema-embed.json
retention-days: 30
20 changes: 20 additions & 0 deletions .github/actions/upload-sdk/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: Upload SDK asset
description: Upload the SDK for a specific language as an asset for the workflow.

inputs:
language:
required: true
description: One of nodejs, python, dotnet, go, java

runs:
using: "composite"
steps:
- name: Compress SDK folder
shell: bash
run: tar -zcf sdk/${{ inputs.language }}.tar.gz -C sdk/${{ inputs.language }} .
- name: Upload artifacts
uses: actions/upload-artifact@65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08 # v4.6.0
with:
name: ${{ inputs.language }}-sdk.tar.gz
path: ${{ github.workspace}}/sdk/${{ inputs.language }}.tar.gz
retention-days: 30
Loading
Loading