Skip to content

Commit 9e09925

Browse files
Alexandre CatalanAlexandre Catalan
authored andcommitted
Merge branch 'main' into feat/STACKITCRE-382-registry
# Conflicts: # docs/stackit_config_unset.md
2 parents bf11d06 + 5f80447 commit 9e09925

789 files changed

Lines changed: 8483 additions & 5948 deletions

File tree

Some content is hidden

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

‎.github/workflows/ci.yaml‎

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ on:
77
branches:
88
- main
99

10+
permissions: {}
11+
1012
env:
1113
CODE_COVERAGE_FILE_NAME: "coverage.out" # must be the same as in Makefile
1214
CODE_COVERAGE_ARTIFACT_NAME: "code-coverage"
@@ -17,10 +19,12 @@ jobs:
1719
runs-on: ubuntu-latest
1820
steps:
1921
- name: Checkout
20-
uses: actions/checkout@v7.0.1
21-
22+
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
23+
with:
24+
persist-credentials: false
25+
2226
- name: Install go
23-
uses: actions/setup-go@v7.0.0
27+
uses: actions/setup-go@b7ad1dad31e06c5925ef5d2fc7ad053ef454303e # v7.0.0
2428
with:
2529
go-version-file: "go.mod"
2630
cache: true
@@ -36,7 +40,7 @@ jobs:
3640
run: make test
3741

3842
- name: Archive code coverage results
39-
uses: actions/upload-artifact@v7
43+
uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
4044
with:
4145
name: ${{ env.CODE_COVERAGE_ARTIFACT_NAME }}
4246
path: ${{ env.CODE_COVERAGE_FILE_NAME }}
@@ -47,10 +51,12 @@ jobs:
4751
runs-on: ubuntu-latest
4852
steps:
4953
- name: Checkout
50-
uses: actions/checkout@v7.0.1
54+
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
55+
with:
56+
persist-credentials: false
5157

5258
- name: Check GoReleaser
53-
uses: goreleaser/goreleaser-action@v7.3.0
59+
uses: goreleaser/goreleaser-action@a4f02ab5355a589de60d917a659ce617ed19b3de # v7.3.0
5460
with:
5561
args: check
5662

@@ -65,7 +71,7 @@ jobs:
6571
pull-requests: write # write permission needed to comment on PR
6672
steps:
6773
- name: Check new code coverage
68-
uses: fgrosse/go-coverage-report@v1.5.0
74+
uses: fgrosse/go-coverage-report@c4bf7e78d1379325814b4dd42d80e526082e788b # v1.5.0
6975
continue-on-error: true # Add this line to prevent pipeline failures in forks
7076
with:
7177
coverage-artifact-name: ${{ env.CODE_COVERAGE_ARTIFACT_NAME }}

‎.github/workflows/labeler.yaml‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ on:
77
# run every full hour (to still label PRs from forks)
88
- cron: '0 * * * *'
99

10+
permissions: {}
11+
1012
jobs:
1113
# this job runs when the workflow was triggered by the 'pull_request' event
1214
pr-labeler:
@@ -20,7 +22,7 @@ jobs:
2022
runs-on: ubuntu-latest
2123
steps:
2224
- name: Labeler action
23-
uses: actions/labeler@v7
25+
uses: actions/labeler@bf12e9b00b37c5c0ca2b87b79b2daf7891dbda13 # v7.0.0
2426
with:
2527
sync-labels: false
2628

@@ -49,7 +51,7 @@ jobs:
4951

5052
- name: Labeler action
5153
if: ${{ steps.fetch-prs.outputs.numbers != '' }}
52-
uses: actions/labeler@v7
54+
uses: actions/labeler@bf12e9b00b37c5c0ca2b87b79b2daf7891dbda13 # v7.0.0
5355
with:
5456
sync-labels: false
5557
pr-number: ${{ steps.fetch-prs.outputs.numbers }}

‎.github/workflows/release.yaml‎

Lines changed: 39 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -10,32 +10,33 @@ on:
1010
- "v[0-9]+.[0-9]+.[0-9]+-*"
1111
workflow_dispatch:
1212

13-
# Releases need permissions to read and write the repository contents.
14-
# GitHub considers creating releases and uploading assets as writing contents.
15-
permissions:
16-
contents: write
13+
permissions: {}
1714

1815
jobs:
1916
goreleaser:
2017
name: Release
2118
runs-on: macOS-latest
19+
permissions:
20+
contents: write # Create releases and upload assets.
21+
issues: write # Notify maintainers about the Homebrew PR.
2222
env:
2323
SNAPCRAFT_STORE_CREDENTIALS: ${{ secrets.SNAPCRAFT_TOKEN }}
2424
steps:
2525
- name: Checkout
26-
uses: actions/checkout@v7.0.1
26+
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
2727
with:
28+
persist-credentials: false
2829
# Allow goreleaser to access older tag information.
2930
fetch-depth: 0
3031

3132
- name: Install go
32-
uses: actions/setup-go@v7.0.0
33+
uses: actions/setup-go@b7ad1dad31e06c5925ef5d2fc7ad053ef454303e # v7.0.0
3334
with:
3435
go-version-file: "go.mod"
35-
cache: true
36+
cache: false # Do not consume CI caches when building release artifacts.
3637

3738
- name: Import GPG key
38-
uses: crazy-max/ghaction-import-gpg@v7
39+
uses: crazy-max/ghaction-import-gpg@2dc316deee8e90f13e1a351ab510b4d5bc0c82cd # v7.0.0
3940
id: import_gpg
4041
with:
4142
gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }}
@@ -71,26 +72,40 @@ jobs:
7172
SIGNING_CERTIFICATE_BASE64: ${{ secrets.APPLICATION_ID_CERT }}
7273
AUTHKEY_BASE64: ${{ secrets.APPLE_API_KEY }}
7374
- name: Install Snapcraft
74-
uses: samuelmeuli/action-snapcraft@v3
75-
75+
uses: samuelmeuli/action-snapcraft@fceeb3c308e76f3487e72ef608618de625fb7fe8 # v3.0.1
76+
7677
- name: Run GoReleaser
77-
uses: goreleaser/goreleaser-action@v7.3.0
78+
uses: goreleaser/goreleaser-action@a4f02ab5355a589de60d917a659ce617ed19b3de # v7.3.0
7879
with:
7980
args: release --clean
8081
env:
81-
GITHUB_TOKEN: ${{ secrets.CLI_RELEASE }}
82+
# GITHUB_TOKEN is used to create the GitHub release in this repository.
83+
# It uses the job-level contents: write permission.
84+
GITHUB_TOKEN: ${{ github.token }}
85+
# HOMEBREW_RELEASE_TOKEN is a PAT belonging to the `stackit-pipeline` user.
86+
# It is used by GoReleaser to push to the tap fork and open the upstream Homebrew PR.
87+
HOMEBREW_RELEASE_TOKEN: ${{ secrets.CLI_RELEASE }}
8288
GPG_FINGERPRINT: ${{ steps.import_gpg.outputs.fingerprint }}
8389
GPG_KEY_PATH: ${{ env.GPG_KEY_PATH }}
8490
# nfpm-rpm signing needs this env to be set.
8591
NFPM_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
8692

93+
- name: Create issue to inform about Homebrew PR
94+
run: |
95+
gh issue create \
96+
--repo "${{ github.repository }}" \
97+
--title "Homebrew Cask PR opened for ${{ github.ref_name }}" \
98+
--body "A pull request has been automatically created for release **${{ github.ref_name }}**"
99+
env:
100+
GH_TOKEN: ${{ github.token }}
101+
87102
- name: Clean up GPG key file
88103
if: always()
89104
run: |
90105
rm -f "$GPG_KEY_PATH"
91106
92107
- name: Upload artifacts to workflow
93-
uses: actions/upload-artifact@v7
108+
uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
94109
with:
95110
name: goreleaser-dist-temp
96111
path: dist
@@ -106,11 +121,13 @@ jobs:
106121
AWS_SECRET_ACCESS_KEY: ${{ secrets.OBJECT_STORAGE_SECRET_ACCESS_KEY }}
107122
steps:
108123
- name: Checkout
109-
uses: actions/checkout@v7.0.1
124+
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
125+
with:
126+
persist-credentials: false
110127

111128
# use the artifacts from the "goreleaser" job
112129
- name: Download artifacts from workflow
113-
uses: actions/download-artifact@v8
130+
uses: actions/download-artifact@9000827ccba6bdab643e8b6fd33ac0654aef8333 # v8.0.2
114131
with:
115132
name: goreleaser-dist-temp
116133
path: dist
@@ -119,7 +136,7 @@ jobs:
119136
run: brew install aptly
120137

121138
- name: Import GPG key
122-
uses: crazy-max/ghaction-import-gpg@v7
139+
uses: crazy-max/ghaction-import-gpg@2dc316deee8e90f13e1a351ab510b4d5bc0c82cd # v7.0.0
123140
id: import_gpg
124141
with:
125142
gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }}
@@ -144,10 +161,12 @@ jobs:
144161
AWS_ENDPOINT_URL: https://object.storage.eu01.onstackit.cloud
145162
steps:
146163
- name: Checkout
147-
uses: actions/checkout@v7.0.1
148-
164+
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
165+
with:
166+
persist-credentials: false
167+
149168
- name: Download artifacts from workflow
150-
uses: actions/download-artifact@v8
169+
uses: actions/download-artifact@9000827ccba6bdab643e8b6fd33ac0654aef8333 # v8.0.2
151170
with:
152171
name: goreleaser-dist-temp
153172
path: dist
@@ -158,7 +177,7 @@ jobs:
158177
sudo apt-get install -y createrepo-c
159178
160179
- name: Import GPG key
161-
uses: crazy-max/ghaction-import-gpg@v7
180+
uses: crazy-max/ghaction-import-gpg@2dc316deee8e90f13e1a351ab510b4d5bc0c82cd # v7.0.0
162181
id: import_gpg
163182
with:
164183
gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }}

‎.github/workflows/stale.yaml‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,18 +13,18 @@ env:
1313
DAYS_BEFORE_PR_CLOSE: 14
1414
EXEMPT_PR_LABELS: "ignore-stale"
1515

16-
permissions:
17-
issues: write
18-
pull-requests: write
16+
permissions: {}
1917

2018
jobs:
2119
stale:
2220
name: "Stale"
2321
runs-on: ubuntu-latest
2422
timeout-minutes: 10
23+
permissions:
24+
pull-requests: write
2525
steps:
2626
- name: "Mark old PRs as stale"
27-
uses: actions/stale@v11.0.0
27+
uses: actions/stale@4391f3da665fdf50b6810c1a66712fb9ba21aa93 # v11.0.0
2828
with:
2929
repo-token: ${{ secrets.GITHUB_TOKEN }}
3030
stale-pr-message: "This PR was marked as stale after ${{ env.DAYS_BEFORE_PR_STALE }} days of inactivity and will be closed after another ${{ env.DAYS_BEFORE_PR_CLOSE }} days of further inactivity. If this PR should be kept open, just add a comment, remove the stale label or push new commits to it."

‎.github/workflows/zizmor.yaml‎

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: GitHub Actions Security
2+
3+
on:
4+
pull_request:
5+
workflow_dispatch:
6+
push:
7+
branches:
8+
- main
9+
10+
permissions: {}
11+
12+
jobs:
13+
zizmor:
14+
name: zizmor
15+
runs-on: ubuntu-latest
16+
permissions:
17+
security-events: write # Upload SARIF to GitHub code scanning.
18+
steps:
19+
- name: Checkout
20+
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
21+
with:
22+
persist-credentials: false
23+
24+
# SARIF findings are enforced through code-scanning policies, not this job's exit status.
25+
- name: Run zizmor
26+
uses: zizmorcore/zizmor-action@45d7276c9ca790aabd705e31ca99c6185c3e76dd # v0.8.1
27+
with:
28+
version: v1.32.0

‎.goreleaser.yaml‎

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -133,8 +133,17 @@ homebrew_casks:
133133
- name: stackit
134134
directory: Casks
135135
repository:
136-
owner: stackitcloud
137-
name: homebrew-tap
136+
# Update of the homebrew cask is created via a fork of the homebrew tap
137+
owner: stackit-pipeline
138+
name: homebrew-tap-fork
139+
token: "{{ .Env.HOMEBREW_RELEASE_TOKEN }}"
140+
branch: "{{.ProjectName}}-{{.Version}}"
141+
pull_request:
142+
enabled: true
143+
base:
144+
owner: stackitcloud
145+
name: homebrew-tap
146+
branch: main
138147
commit_author:
139148
name: CLI Release Bot
140149
email: noreply@stackit.de

‎README.md‎

Lines changed: 12 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -66,37 +66,18 @@ Help is available for any command by specifying the special flag `--help` (or si
6666

6767
## Available services
6868

69-
Below you can find a list of the STACKIT services already available in the CLI (along with their respective command names) and the ones that are currently planned to be integrated.
70-
71-
| Service | CLI Commands | Status |
72-
|------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------------------------|
73-
| Application Load Balancer | `beta alb` | :white_check_mark: (beta) |
74-
| Authorization | `project`, `organization` | :white_check_mark: |
75-
| DNS | `dns` | :white_check_mark: |
76-
| Edge Cloud | `beta edge-cloud` | :white_check_mark: (beta) |
77-
| File Storage (SFS) | `sfs` | :white_check_mark: |
78-
| Git | `git` | :white_check_mark: |
79-
| Infrastructure as a Service (IaaS) | `affinity-group` <br/> `image` <br/> `key-pair` <br/> `network` <br/> `network-area` <br/> `network-interface` <br/> `public-ip` <br/> `quota` <br/> `security-group` <br/> `server` <br/> `volume` | :white_check_mark: |
80-
| Intake | `beta intake` | :white_check_mark: (beta) |
81-
| Key Management Service (KMS) | `beta kms` | :white_check_mark: (beta) |
82-
| Kubernetes Engine (SKE) | `ske` | :white_check_mark: |
83-
| Load Balancer | `load-balancer` | :white_check_mark: |
84-
| LogMe | `logme` | :white_check_mark: |
85-
| MariaDB | `mariadb` | :white_check_mark: |
86-
| MongoDB Flex | `mongodbflex` | :white_check_mark: |
87-
| Observability | `observability` | :white_check_mark: |
88-
| Object Storage | `object-storage` | :white_check_mark: |
89-
| OpenSearch | `opensearch` | :white_check_mark: |
90-
| PostgreSQL Flex | `postgresflex` | :white_check_mark: |
91-
| RabbitMQ | `rabbitmq` | :white_check_mark: |
92-
| Redis | `redis` | :white_check_mark: |
93-
| Resource Manager | `project` | :white_check_mark: |
94-
| STACKIT Cloud Foundry | `beta scf` | :white_check_mark: (beta) |
95-
| Secrets Manager | `secrets-manager` | :white_check_mark: |
96-
| Server Backup Management | `server backup` | :white_check_mark: |
97-
| Server Command (Run Command) | `server command` | :white_check_mark: |
98-
| Service Account | `service-account` | :white_check_mark: |
99-
| SQLServer Flex | `sqlserverflex` | :white_check_mark: |
69+
Using the commands below you can get an overview which services are supported by your installed STACKIT CLI version:
70+
71+
```bash
72+
# show list of available services / commands
73+
stackit --help
74+
75+
# show list of available services in alpha stage
76+
stackit alpha --help
77+
78+
# show list of available services in beta stage
79+
stackit beta --help
80+
```
10081

10182
## Authentication
10283

‎docs/stackit.md‎

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,14 @@ stackit [flags]
1414
### Options
1515

1616
```
17-
-y, --assume-yes If set, skips all confirmation prompts
18-
--async If set, runs the command asynchronously
19-
-h, --help Help for "stackit"
20-
-o, --output-format string Output format, (one of: [json, pretty, none, yaml])
21-
-p, --project-id string Project ID
22-
--region string Target region for region-specific requests
23-
--verbosity string Verbosity of the CLI, (one of: [debug, info, warning, error]) (default "info")
24-
-v, --version Show "stackit" version
17+
-y, --assume-yes[=true|false] If set, skips all confirmation prompts
18+
--async[=true|false] If set, runs the command asynchronously
19+
-h, --help[=true|false] Help for "stackit"
20+
-o, --output-format string Output format, (one of: [json, pretty, none, yaml])
21+
-p, --project-id string Project ID
22+
--region string Target region for region-specific requests
23+
--verbosity string Verbosity of the CLI, (one of: [debug, info, warning, error]) (default "info")
24+
-v, --version[=true|false] Show "stackit" version
2525
```
2626

2727
### SEE ALSO

0 commit comments

Comments
 (0)