Skip to content

Commit

Permalink
Crane provider for pulumi
Browse files Browse the repository at this point in the history
  • Loading branch information
Zemnmez committed Oct 27, 2024
1 parent 4584ae7 commit 1b1e931
Show file tree
Hide file tree
Showing 90 changed files with 5,259 additions and 30 deletions.
56 changes: 28 additions & 28 deletions MODULE.bazel.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 6 additions & 1 deletion gazelle_python.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions go/gazelle/ts/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -309,6 +309,10 @@ func generateRule(fileName string, args language.GenerateArgs) (res *GenerateRul

r.SetAttr("src", fileName)

if args.File == nil {
return nil, nil
}

res = &GenerateRuleResult{
rule: r,
imports: NewDepSet(args.File.Pkg, conf.Extends.Strings()...),
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
// Reference:
// - https://containers.dev/features
// - https://containers.dev/implementors/features
// - https://code.visualstudio.com/docs/getstarted/settings
{
"name": "pulumi",
"image": "ghcr.io/pulumi/devcontainer",
"customizations": {
"vscode": {
"settings": [
"go.testTags", "all",
"go.buildTags", "all",
"editor.minimap.enabled", false,
"explorer.openEditors.visible", 1,
"editor.quickSuggestionsDelay", 0,
"editor.suggestSelection", "first",
"editor.snippetSuggestions", "top",
"editor.gotoLocation.multipleReferences", "goto",
"editor.gotoLocation.multipleDefinitions", "goto",
"editor.gotoLocation.multipleDeclarations", "goto",
"editor.gotoLocation.multipleImplementations", "goto",
"editor.gotoLocation.multipleTypeDefinitions", "goto",
"editor.terminal.integrated.shell.linux", "/usr/bin/zsh",
"files.trimTrailingWhitespace", true,
"files.trimFinalNewlines", true
],
"extensions": [
"golang.go",
"vscodevim.vim",
"github.copilot",
"ms-python.python",
"jetpack-io.devbox",
"redhat.vscode-yaml",
"esbenp.prettier-vscode",
"ms-vscode.makefile-tools",
"ms-azuretools.vscode-docker",
"github.vscode-pull-request-github",
"ms-vscode-remote.remote-containers",
"visualstudioexptteam.vscodeintellicode",
"bierner.markdown-preview-github-styles"
]
}
},
"features": {
"ghcr.io/devcontainers/features/common-utils:2": {
"installZsh": true,
"configureZshAsDefaultShell": true,
"installOhMyZsh": true,
"installOhMyZshConfig": true,
"upgradePackages": true,
"nonFreePackages": true,
"username": "vscode",
"userUid": "automatic",
"userGid": "automatic"
},
"ghcr.io/devcontainers/features/docker-outside-of-docker:1": {
"moby": false,
"installDockerBuildx": true,
"version": "latest",
"dockerDashComposeVersion": "v2"
}
},
"postCreateCommand": "git submodule update --init --recursive",
"remoteUser": "vscode",
"forwardPorts": [1313],
"runArgs": ["--network=host"]
}

Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
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

runs:
using: "composite"
steps:
- name: Install Go
if: inputs.tools == 'all' || contains(inputs.tools, 'go')
uses: actions/setup-go@v5
with:
go-version: "1.21.x"
cache-dependency-path: |
provider/*.sum
upstream/*.sum
sdk/*.sum
- name: Install pulumictl
if: inputs.tools == 'all' || contains(inputs.tools, 'pulumictl')
uses: jaxxstorm/[email protected]
with:
tag: v0.0.46
repo: pulumi/pulumictl

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

- name: Install Schema Tools
if: inputs.tools == 'all' || contains(inputs.tools, 'schema-tools')
uses: jaxxstorm/[email protected]
with:
repo: pulumi/schema-tools

- name: Setup Node
if: inputs.tools == 'all' || contains(inputs.tools, 'nodejs')
uses: actions/setup-node@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@v4
with:
dotnet-version: 6.0.x

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

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

- name: Setup Gradle
if: inputs.tools == 'all' || contains(inputs.tools, 'java')
uses: gradle/gradle-build-action@v3
with:
gradle-version: 7.6
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
name: Makefile

on:
workflow_dispatch:
push:
branches:
- main
pull_request:
branches:
- main
schedule:
- cron: "0 0 * * *"

jobs:
build:
runs-on: ubuntu-latest
container:
image: docker://ghcr.io/pulumi/devcontainer:latest
options: --user root
permissions:
contents: read
packages: read
actions: read
steps:
- name: Checkout repository
uses: actions/checkout@v4
id: git
with:
submodules: "recursive"
- name: Unshallow clone for tags
id: tags
run: |
sudo chown -R $(whoami) /__w/pulumi-provider-boilerplate/pulumi-provider-boilerplate
git config --global --add safe.directory /__w/pulumi-provider-boilerplate/pulumi-provider-boilerplate
git fetch --prune --unshallow --tags
- name: Setup tools
uses: ./.github/actions/setup-tools
with:
tools: go, pulumicli, pulumictl, nodejs, python, dotnet
- name: Build
id: build
run: |
make build
- name: Install
id: install
run: |
set -ex
make install
- name: PulumiUp
id: up
run: make up
- name: PulumiDown
id: down
run: make down
- name: Generate multi-language examples from yaml IaC program
id: examples
run: |
set -ex
make gen_examples
13 changes: 13 additions & 0 deletions go/pulumi/plugin/pulumi-component-provider-crane/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
/vendor/
**/bin/
**/obj/
**/node_modules/
**/.vs
**/.idea
**/.ionide
.pulumi
Pulumi.*.yaml
yarn.lock
ci-scripts
/nuget/
provider/**/schema-embed.json
3 changes: 3 additions & 0 deletions go/pulumi/plugin/pulumi-component-provider-crane/.gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule ".devcontainer"]
path = third_party/pulumi-component-provider-boilerplate/.devcontainer
url = https://github.com/pulumi/devcontainer
Loading

0 comments on commit 1b1e931

Please sign in to comment.