Skip to content

Commit df33187

Browse files
Fyuseldiriendependabot[bot]
authored
Move pulumi code (#2)
* Initial commit * feat: complete pulumi stackit provider implementation - Initial provider setup with Terraform Bridge v3 - Generated SDKs for all supported languages (Go, Node.js, Python, .NET) - Added comprehensive configuration documentation - Created CLAUDE.md development guide - Full resource coverage for STACKIT cloud services * feat: initial sdk generation (#6) * feat: tweaking the bridging code after some tests. (#7) * fix: missing version (#8) * chore(deps): bump sigstore/cosign-installer from 3.8.1 to 3.9.1 (#2) * chore(deps): bump pulumi/pulumi-upgrade-provider-action (#3) * chore(deps): bump anchore/sbom-action from 0.18.0 to 0.20.1 (#5) * chore(deps): bump goreleaser/goreleaser-action from 6.2.1 to 6.3.0 (#4) * feat: add another example. (#9) * chore(deps): bump pulumi/pulumi in /.devcontainer (#10) * chore(deps): bump anchore/sbom-action from 0.20.1 to 0.20.2 (#11) * Ft/adjust pulumi code (#3) * Adjust go code to use new repository Signed-off-by: Alexander Dahmen <[email protected]> * Adjust dotnet, nodejs and python Signed-off-by: Alexander Dahmen <[email protected]> * Add dotnet example Signed-off-by: Alexander Dahmen <[email protected]> --------- Signed-off-by: Alexander Dahmen <[email protected]> --------- Signed-off-by: Alexander Dahmen <[email protected]> Co-authored-by: Engin Diri <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
1 parent df3188b commit df33187

File tree

779 files changed

+183250
-2
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

779 files changed

+183250
-2
lines changed

.devcontainer/Dockerfile

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
FROM --platform=linux/amd64 pulumi/pulumi:3.181.0
2+
3+
4+
# create a directory for pulumictl and download the binary to it and set to PATH
5+
RUN mkdir -p /root/pulumictl && cd /root/pulumictl/
6+
RUN wget https://github.com/pulumi/pulumictl/releases/download/v0.0.42/pulumictl-v0.0.42-linux-amd64.tar.gz -O /root/pulumictl/pulumictl-v0.0.42-linux-amd64.tar.gz
7+
RUN tar -xvf /root/pulumictl/pulumictl-v0.0.42-linux-amd64.tar.gz -C /root/pulumictl/
8+
ENV PATH="//root/pulumictl/:${PATH}"
9+
10+
RUN apt update
11+
RUN apt install sudo -y
12+
13+
RUN type -p curl >/dev/null || (sudo apt update && sudo apt install curl -y)
14+
RUN curl -fsSL https://cli.github.com/packages/githubcli-archive-keyring.gpg | sudo dd of=/usr/share/keyrings/githubcli-archive-keyring.gpg
15+
RUN sudo chmod go+r /usr/share/keyrings/githubcli-archive-keyring.gpg
16+
RUN echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main" | sudo tee /etc/apt/sources.list.d/github-cli.list > /dev/null
17+
RUN sudo apt update
18+
RUN sudo apt install gh -y
19+
RUN sudo apt install vim -y
20+
21+
RUN go install github.com/pulumi/upgrade-provider@main
22+
RUN pip install setuptools

.devcontainer/devcontainer.json

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"build": {
3+
"dockerfile": "Dockerfile"
4+
},
5+
"customizations": {
6+
"vscode": {
7+
"extensions": [
8+
"golang.go"
9+
]
10+
}
11+
}
12+
}

.github/CODEOWNERS

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
* @stackitcloud/developer-tools
1+
* @stackitcloud/developer-tools

.github/dependabot.yml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: "gomod"
4+
directory: "/provider"
5+
schedule:
6+
interval: "weekly"
7+
time: "08:00"
8+
day: "sunday"
9+
labels:
10+
- "dependencies"
11+
commit-message:
12+
prefix: "chore"
13+
include: "scope"
14+
- package-ecosystem: "gomod"
15+
directory: "/sdk"
16+
schedule:
17+
interval: "weekly"
18+
day: "sunday"
19+
time: "08:00"
20+
labels:
21+
- "dependencies"
22+
commit-message:
23+
prefix: "chore"
24+
include: "scope"
25+
- package-ecosystem: "github-actions"
26+
directory: "/"
27+
schedule:
28+
interval: "weekly"
29+
day: "sunday"
30+
time: "08:00"
31+
labels:
32+
- "dependencies"
33+
commit-message:
34+
prefix: "chore"
35+
include: "scope"
36+
- package-ecosystem: "docker"
37+
directory: "/.devcontainer"
38+
schedule:
39+
interval: "daily"
40+
labels:
41+
- "dependencies"
42+
commit-message:
43+
prefix: "chore"
44+
include: "scope"
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
env:
2+
GH_TOKEN: ${{ secrets.GH_TOKEN }}
3+
jobs:
4+
upgrade_provider:
5+
name: upgrade-provider
6+
runs-on: ubuntu-latest
7+
steps:
8+
- name: Call upgrade provider action
9+
uses: pulumi/pulumi-upgrade-provider-action@3c670a7cb92732324c8ccc17f7f9ef9dfca126d0 # v0.0.17
10+
with:
11+
kind: check-upstream-version
12+
13+
permissions:
14+
contents: write
15+
16+
name: Check upstream upgrade
17+
on:
18+
workflow_dispatch: {} #so we can run this manually if necessary.
19+
schedule:
20+
# 3 AM UTC ~ 8 PM PDT / 7 PM PST daily. Time chosen to run during off hours.
21+
- cron: 0 3 * * *

.github/workflows/release.yaml

Lines changed: 144 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,144 @@
1+
name: release
2+
on:
3+
push:
4+
tags:
5+
- v*.*.*
6+
workflow_dispatch:
7+
8+
permissions:
9+
contents: write
10+
id-token: write
11+
12+
env:
13+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
14+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
15+
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
16+
NUGET_PUBLISH_KEY: ${{ secrets.NUGET_PUBLISH_KEY }}
17+
NUGET_FEED_URL: https://api.nuget.org/v3/index.json
18+
PROVIDER: stackit
19+
PULUMI_GO_DEP_ROOT: ${{ github.workspace }}/..
20+
PULUMI_LOCAL_NUGET: ${{ github.workspace }}/nuget
21+
PYPI_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
22+
PYPI_USERNAME: "__token__"
23+
PUBLISH_PYPI: true
24+
PUBLISH_NPM: true
25+
PUBLISH_NUGET: true
26+
jobs:
27+
publish_binary:
28+
name: publish
29+
runs-on: ubuntu-latest
30+
steps:
31+
- name: Checkout Repo
32+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # tag=v4.2.2
33+
- name: Unshallow clone for tags
34+
run: git fetch --prune --unshallow --tags
35+
- name: Install Go
36+
uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # tag=v5.5.0
37+
with:
38+
go-version: ${{matrix.goversion}}
39+
- name: Install pulumictl
40+
uses: jaxxstorm/action-install-gh-release@6096f2a2bbfee498ced520b6922ac2c06e990ed2 # tag=v2.1.0
41+
with:
42+
repo: pulumi/pulumictl
43+
- name: Set PreRelease Version
44+
run: echo "GORELEASER_CURRENT_TAG=v$(pulumictl get version --language generic)" >> $GITHUB_ENV
45+
- uses: sigstore/cosign-installer@398d4b0eeef1380460a10c8013a76f728fb906ac # v3.9.1
46+
- uses: anchore/sbom-action/download-syft@cee1b8e05ae5b2593a75e197229729eabaa9f8ec # v0.20.2
47+
- name: Run GoReleaser
48+
uses: goreleaser/goreleaser-action@9c156ee8a17a598857849441385a2041ef570552 # tag=v6.3.0
49+
with:
50+
args: -p 3 release --clean
51+
version: '~> v2'
52+
- name: Create tag
53+
uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # tag=v7.0.1
54+
with:
55+
script: |
56+
github.rest.git.createRef({
57+
owner: context.repo.owner,
58+
repo: context.repo.repo,
59+
ref: 'refs/tags/sdk/${{ github.ref_name }}',
60+
sha: context.sha
61+
})
62+
strategy:
63+
fail-fast: true
64+
matrix:
65+
goversion:
66+
- 1.22.x
67+
publish_sdk:
68+
name: Publish SDKs
69+
runs-on: ubuntu-latest
70+
needs: publish_binary
71+
steps:
72+
- name: Checkout Repo
73+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # tag=v4.2.2
74+
- name: Unshallow clone for tags
75+
run: git fetch --prune --unshallow --tags
76+
- name: Install Go
77+
uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # tag=v5.5.0
78+
with:
79+
go-version: ${{ matrix.goversion }}
80+
- name: Install pulumictl
81+
uses: jaxxstorm/action-install-gh-release@6096f2a2bbfee498ced520b6922ac2c06e990ed2 # tag=v2.1.0
82+
with:
83+
repo: pulumi/pulumictl
84+
- name: Install Pulumi CLI
85+
uses: pulumi/action-install-pulumi-cli@b374ceb6168550de27c6eba92e01c1a774040e11 # tag=v2.0.0
86+
- name: Setup Node
87+
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # tag=v4.4.0
88+
with:
89+
node-version: ${{matrix.nodeversion}}
90+
registry-url: ${{env.NPM_REGISTRY_URL}}
91+
- name: Setup DotNet
92+
uses: actions/setup-dotnet@67a3573c9a986a3f9c594539f4ab511d57bb3ce9 # tag=v2.1.0
93+
with:
94+
dotnet-version: ${{matrix.dotnetverson}}
95+
- name: Setup Python
96+
uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # tag=v5.6.0
97+
with:
98+
python-version: ${{matrix.pythonversion}}
99+
- name: Build SDK
100+
run: make build_${{ matrix.language }}
101+
- name: Check worktree clean
102+
run: |
103+
git update-index -q --refresh
104+
if ! git diff-files --quiet; then
105+
>&2 echo "error: working tree is not clean, aborting!"
106+
git status
107+
git diff
108+
exit 1
109+
fi
110+
- if: ${{ matrix.language == 'python' && env.PUBLISH_PYPI == 'true' }}
111+
name: Publish package to PyPI
112+
uses: pypa/gh-action-pypi-publish@76f52bc884231f62b9a034ebfe128415bbaabdfc # tag=v1.12.4
113+
with:
114+
user: ${{ env.PYPI_USERNAME }}
115+
password: ${{ env.PYPI_PASSWORD }}
116+
packages_dir: ${{github.workspace}}/sdk/python/bin/dist
117+
- if: ${{ matrix.language == 'nodejs' && env.PUBLISH_NPM == 'true' }}
118+
uses: JS-DevTools/npm-publish@19c28f1ef146469e409470805ea4279d47c3d35c # tag=v3.1.1
119+
with:
120+
access: "public"
121+
token: ${{ env.NPM_TOKEN }}
122+
package: ${{github.workspace}}/sdk/nodejs/bin/package.json
123+
provenance: true
124+
- if: ${{ matrix.language == 'dotnet' && env.PUBLISH_NUGET == 'true' }}
125+
name: publish nuget package
126+
run: |
127+
dotnet nuget push ${{github.workspace}}/sdk/dotnet/bin/Debug/*.nupkg -s ${{ env.NUGET_FEED_URL }} -k ${{ env.NUGET_PUBLISH_KEY }}
128+
echo "done publishing packages"
129+
strategy:
130+
fail-fast: true
131+
matrix:
132+
dotnetversion:
133+
- 3.1.301
134+
goversion:
135+
- 1.22.x
136+
language:
137+
- nodejs
138+
- python
139+
- dotnet
140+
- go
141+
nodeversion:
142+
- 20.x
143+
pythonversion:
144+
- "3.9"
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
env:
2+
GH_TOKEN: ${{ secrets.GH_TOKEN }}
3+
jobs:
4+
upgrade_provider:
5+
if: ${{ (contains(github.event.issue.title, 'Upgrade terraform-provider-')) || github.event_name == 'workflow_dispatch' }}
6+
name: upgrade-provider
7+
runs-on: ubuntu-latest
8+
steps:
9+
- name: Call upgrade provider action
10+
uses: pulumi/pulumi-upgrade-provider-action@3c670a7cb92732324c8ccc17f7f9ef9dfca126d0 # v0.0.17
11+
with:
12+
kind: all
13+
name: Upgrade provider
14+
15+
permissions:
16+
contents: write
17+
18+
on:
19+
issues:
20+
types:
21+
- opened
22+
workflow_dispatch: {}

.gitignore

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
.idea
2+
.code
3+
**/vendor/
4+
.pulumi
5+
**/bin/
6+
**/obj/
7+
Pulumi.*.yaml
8+
**/node_modules/
9+
.DS_Store
10+
11+
**/command-output/
12+
13+
.idea/
14+
*.iml
15+
16+
yarn.lock
17+
**/pulumiManifest.go
18+
19+
ci-scripts
20+
provider/**/schema-embed.json
21+
**/version.txt
22+
**/nuget
23+
**/dist

.golangci.yml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
linters:
2+
enable:
3+
- deadcode
4+
- errcheck
5+
- goconst
6+
- gofmt
7+
- golint
8+
- gosec
9+
- govet
10+
- ineffassign
11+
- interfacer
12+
- lll
13+
- megacheck
14+
- misspell
15+
- nakedret
16+
- structcheck
17+
- unconvert
18+
- varcheck
19+
enable-all: false
20+
run:
21+
skip-files:
22+
- schema.go
23+
- pulumiManifest.go
24+
timeout: 20m

.goreleaser.yaml

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
version: 2
2+
archives:
3+
- id: archive
4+
name_template: '{{ .Binary }}-{{ .Tag }}-{{ .Os }}-{{ .Arch }}'
5+
6+
before:
7+
hooks:
8+
- make tfgen
9+
builds:
10+
- binary: pulumi-resource-stackit
11+
dir: provider
12+
env:
13+
- CGO_ENABLED=0
14+
goarch:
15+
- amd64
16+
- arm64
17+
goos:
18+
- darwin
19+
- windows
20+
- linux
21+
ldflags:
22+
# The line below MUST align with the module in current provider/go.mod
23+
- -X github.com/stackitcloud/pulumi-stackit/provider/pkg/version.Version={{.Tag }}
24+
main: ./cmd/pulumi-resource-stackit/
25+
26+
signs:
27+
- cmd: cosign
28+
env:
29+
- COSIGN_EXPERIMENTAL=1
30+
certificate: '${artifact}.pem'
31+
args:
32+
- sign-blob
33+
- '-y'
34+
- '--output-certificate=${certificate}'
35+
- '--bundle=${signature}'
36+
- '${artifact}'
37+
artifacts: all
38+
output: true
39+
40+
sboms:
41+
- artifacts: archive
42+
- id: source
43+
artifacts: source
44+
45+
source:
46+
enabled: true
47+
48+
changelog:
49+
sort: asc
50+
use: github
51+
filters:
52+
exclude:
53+
- '^test:'
54+
- '^chore'
55+
- Merge pull request
56+
- Merge remote-tracking branch
57+
- Merge branch
58+
- go mod tidy
59+
groups:
60+
- title: 'New Features'
61+
regexp: "^.*feat[(\\w)]*:+.*$"
62+
order: 0
63+
- title: 'Bug fixes'
64+
regexp: "^.*fix[(\\w)]*:+.*$"
65+
order: 10
66+
- title: Other work
67+
order: 999
68+
69+
release:
70+
disable: false
71+
prerelease: auto
72+
73+
snapshot:
74+
name_template: '{{ .Tag }}-SNAPSHOT'

0 commit comments

Comments
 (0)