Skip to content

Commit 80f4e67

Browse files
author
Marius Boden
committed
feat(init): initial release
1 parent b602784 commit 80f4e67

23 files changed

+1117
-1
lines changed

.devcontainer/devcontainer.json

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
// For format details, see https://aka.ms/devcontainer.json. For config options, see the
2+
// README at: https://github.com/devcontainers/templates/tree/main/src/ubuntu
3+
{
4+
"name": "Ubuntu",
5+
// Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile
6+
"image": "mcr.microsoft.com/devcontainers/base:jammy",
7+
"features": {
8+
"ghcr.io/devcontainers/features/terraform:1": {},
9+
"ghcr.io/devcontainers-contrib/features/terraform-docs:1": {},
10+
"ghcr.io/devcontainers/features/azure-cli:1": {},
11+
"ghcr.io/devcontainers/features/docker-in-docker:2": {},
12+
"ghcr.io/devcontainers-contrib/features/kind:1": {},
13+
"ghcr.io/devcontainers/features/kubectl-helm-minikube:1": {},
14+
"ghcr.io/dhoeric/features/stern:1": {}
15+
},
16+
"customizations": {
17+
"vscode": {
18+
"extensions": [
19+
"github.vscode-github-actions",
20+
"redhat.vscode-yaml"
21+
]
22+
}
23+
}
24+
// Features to add to the dev container. More info: https://containers.dev/features.
25+
// "features": {},
26+
// Use 'forwardPorts' to make a list of ports inside the container available locally.
27+
// "forwardPorts": [],
28+
// Use 'postCreateCommand' to run commands after the container is created.
29+
// "postCreateCommand": "uname -a",
30+
// Configure tool-specific properties.
31+
// "customizations": {},
32+
// Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root.
33+
// "remoteUser": "root"
34+
}

.github/dependabot.yml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# To get started with Dependabot version updates, you'll need to specify which
2+
# package ecosystems to update and where the package manifests are located.
3+
# Please see the documentation for all configuration options:
4+
# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates
5+
6+
version: 2
7+
updates:
8+
- package-ecosystem: "github-actions"
9+
directory: "/"
10+
schedule:
11+
# Check for updates to GitHub Actions every week
12+
interval: "weekly"
13+
reviewers:
14+
- infinite-automations/admins
15+
- package-ecosystem: "terraform"
16+
directory: "/"
17+
schedule:
18+
# Check for updates to terraform every week
19+
interval: "weekly"
20+
reviewers:
21+
- infinite-automations/admins
22+
- package-ecosystem: "terraform"
23+
directory: "examples/full"
24+
schedule:
25+
# Check for updates to terraform every week
26+
interval: "weekly"
27+
reviewers:
28+
- infinite-automations/admins
Lines changed: 165 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,165 @@
1+
name: Test & Release
2+
3+
on:
4+
push:
5+
branches: ["main"]
6+
pull_request:
7+
branches: ["main"]
8+
9+
permissions:
10+
actions: read
11+
contents: write
12+
statuses: read
13+
14+
env:
15+
TF_VAR_github_app_id: ${{ secrets.GH_APP_ID }}
16+
TF_VAR_github_app_install_id: ${{ secrets.GH_APP_INSTALL_ID }}
17+
TF_VAR_github_app_private_key: ${{ secrets.GH_APP_KEY }}
18+
TF_VAR_labels: '["test", "${{ github.run_id }}"]'
19+
20+
jobs:
21+
lint:
22+
name: Lint
23+
runs-on: ubuntu-latest
24+
strategy:
25+
matrix:
26+
directory:
27+
- "."
28+
- "examples/full"
29+
steps:
30+
- name: Checkout
31+
uses: actions/checkout@v4
32+
- name: Lint Example
33+
uses: "infinite-automations/[email protected]"
34+
with:
35+
directory: ${{ matrix.directory }}
36+
37+
update-docs:
38+
name: Update Docs
39+
needs:
40+
- lint
41+
runs-on: ubuntu-latest
42+
concurrency:
43+
group: ${{ github.ref }}-docs
44+
cancel-in-progress: false
45+
outputs:
46+
changed: ${{ steps.terraform-docs.outputs.num_changed > 0 }}
47+
steps:
48+
- name: Checkout
49+
uses: actions/checkout@v4
50+
if: ${{ github.event_name == 'push' }}
51+
- name: Checkout
52+
uses: actions/checkout@v4
53+
if: ${{ github.event_name == 'pull_request' }}
54+
with:
55+
ref: ${{ github.event.pull_request.head.ref }}
56+
- name: Render terraform docs inside the README.md
57+
id: terraform-docs
58+
uses: terraform-docs/[email protected]
59+
with:
60+
working-dir: .,examples/full
61+
output-file: README.md
62+
output-method: inject
63+
git-push: ${{ github.event_name == 'pull_request' }}
64+
git-commit-message: "docs(terraform): update README.md"
65+
- name: Cache Docs
66+
if: ${{ github.event_name == 'push' }}
67+
uses: actions/cache@v3
68+
with:
69+
path: |
70+
README.md
71+
examples/full/README.md
72+
key: ${{ runner.os }}-docs-${{ github.sha }}
73+
74+
setup-runner:
75+
name: Setup Runner
76+
needs:
77+
- lint
78+
- update-docs
79+
runs-on: ubuntu-latest
80+
steps:
81+
- name: Checkout
82+
uses: actions/checkout@v4
83+
- name: Create k8s Kind Cluster
84+
uses: helm/[email protected]
85+
with:
86+
wait: "120s"
87+
- name: Create Runners
88+
uses: infinite-automations/[email protected]
89+
id: apply-example
90+
with:
91+
directory: "examples/full"
92+
plan: false
93+
apply: true
94+
destroy: false
95+
- name: Wait For Test
96+
uses: yogeshlonkar/wait-for-jobs@v0
97+
with:
98+
gh-token: ${{ secrets.GITHUB_TOKEN }}
99+
jobs: "Test"
100+
prefix: true
101+
ttl: "10"
102+
- name: Destroy Runners
103+
uses: infinite-automations/[email protected]
104+
if: always()
105+
with:
106+
directory: "examples/full"
107+
plan: false
108+
apply: false
109+
destroy: true
110+
destroy-args: '-target="kubectl_manifest.runner"'
111+
112+
test-runner:
113+
name: Test
114+
needs:
115+
- lint
116+
- update-docs
117+
runs-on:
118+
- self-hosted
119+
- test
120+
- ${{ github.run_id }}
121+
strategy:
122+
matrix:
123+
image:
124+
- alpine:latest
125+
- ubuntu:latest
126+
- debian:latest
127+
container:
128+
image: ${{ matrix.image }}
129+
timeout-minutes: 10
130+
steps:
131+
- name: Print Environment Information
132+
run: |
133+
echo "Operating System: $OSTYPE"
134+
echo "Hostname: $(hostname)"
135+
echo "CPU Architecture: $(uname -m)"
136+
echo "Kernel Version: $(uname -r)"
137+
echo
138+
cat /etc/os-release
139+
140+
release:
141+
name: Release
142+
needs:
143+
- update-docs
144+
- setup-runner
145+
- test-runner
146+
concurrency:
147+
group: ${{ github.ref }}-release
148+
cancel-in-progress: false
149+
runs-on: ubuntu-latest
150+
steps:
151+
- name: Checkout
152+
uses: actions/checkout@v4
153+
- name: Restore Cached Docs
154+
if: ${{ github.event_name == 'push' }}
155+
uses: actions/cache@v3
156+
with:
157+
path: README.md
158+
key: ${{ runner.os }}-docs-${{ github.sha }}
159+
- name: Semantic Release
160+
uses: cycjimmy/semantic-release-action@v4
161+
with:
162+
dry_run: ${{ github.event_name == 'pull_request' }}
163+
ci: true
164+
env:
165+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
#dev
2+
/dev
3+
14
# Local .terraform directories
25
**/.terraform/*
36

.releaserc.json

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
{
2+
"branches": [
3+
"main"
4+
],
5+
"tagFormat": "${version}",
6+
"plugins": [
7+
"@semantic-release/commit-analyzer",
8+
"@semantic-release/release-notes-generator",
9+
[
10+
"@semantic-release/changelog",
11+
{
12+
"changelogFile": "CHANGELOG.md"
13+
}
14+
],
15+
[
16+
"@semantic-release/git",
17+
{
18+
"message": "chore(release): ${nextRelease.version} [skip ci]\n\n${nextRelease.notes}",
19+
"assets": [
20+
"CHANGELOG.md",
21+
"README.md",
22+
"examples/full/README.md"
23+
]
24+
}
25+
],
26+
"@semantic-release/github"
27+
]
28+
}

.terraform-docs.yml

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
# .terraform-docs.yml
2+
formatter: "markdown table"
3+
4+
sections:
5+
show:
6+
- header
7+
- requirements
8+
- providers
9+
- resources
10+
- inputs
11+
- outputs
12+
- footer
13+
14+
content: |-
15+
{{ .Header }}
16+
17+
## Module Usage
18+
19+
```hcl
20+
{{ include "examples/full/main.tf" }}
21+
```
22+
23+
{{ .Requirements }}
24+
25+
{{ .Providers }}
26+
27+
{{ .Resources }}
28+
29+
{{ .Inputs }}
30+
31+
{{ .Outputs }}
32+
33+
{{ .Footer }}
34+
35+
sort:
36+
enabled: true
37+
by: required
38+
39+
settings:
40+
anchor: true
41+
default: true
42+
required: true
43+
type: true
44+
hide-empty: true
45+
indent: 2

0 commit comments

Comments
 (0)