-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Marius Boden
committed
Dec 6, 2023
1 parent
b602784
commit 10f8891
Showing
24 changed files
with
1,208 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
// For format details, see https://aka.ms/devcontainer.json. For config options, see the | ||
// README at: https://github.com/devcontainers/templates/tree/main/src/ubuntu | ||
{ | ||
"name": "Ubuntu", | ||
// Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile | ||
"image": "mcr.microsoft.com/devcontainers/base:jammy", | ||
"features": { | ||
"ghcr.io/devcontainers/features/terraform:1": {}, | ||
"ghcr.io/devcontainers-contrib/features/terraform-docs:1": {}, | ||
"ghcr.io/devcontainers/features/azure-cli:1": {}, | ||
"ghcr.io/devcontainers/features/docker-in-docker:2": {}, | ||
"ghcr.io/devcontainers-contrib/features/kind:1": {}, | ||
"ghcr.io/devcontainers/features/kubectl-helm-minikube:1": {}, | ||
"ghcr.io/dhoeric/features/stern:1": {} | ||
}, | ||
"customizations": { | ||
"vscode": { | ||
"extensions": [ | ||
"github.vscode-github-actions", | ||
"redhat.vscode-yaml" | ||
] | ||
} | ||
} | ||
// Features to add to the dev container. More info: https://containers.dev/features. | ||
// "features": {}, | ||
// Use 'forwardPorts' to make a list of ports inside the container available locally. | ||
// "forwardPorts": [], | ||
// Use 'postCreateCommand' to run commands after the container is created. | ||
// "postCreateCommand": "uname -a", | ||
// Configure tool-specific properties. | ||
// "customizations": {}, | ||
// Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root. | ||
// "remoteUser": "root" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
# To get started with Dependabot version updates, you'll need to specify which | ||
# package ecosystems to update and where the package manifests are located. | ||
# Please see the documentation for all configuration options: | ||
# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates | ||
|
||
version: 2 | ||
updates: | ||
- package-ecosystem: "github-actions" | ||
directory: "/" | ||
schedule: | ||
# Check for updates to GitHub Actions every week | ||
interval: "weekly" | ||
reviewers: | ||
- infinite-automations/admins | ||
- package-ecosystem: "terraform" | ||
directory: "/" | ||
schedule: | ||
# Check for updates to terraform every week | ||
interval: "weekly" | ||
reviewers: | ||
- infinite-automations/admins | ||
- package-ecosystem: "terraform" | ||
directory: "examples/full" | ||
schedule: | ||
# Check for updates to terraform every week | ||
interval: "weekly" | ||
reviewers: | ||
- infinite-automations/admins |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,165 @@ | ||
name: Test & Release | ||
|
||
on: | ||
push: | ||
branches: ["main"] | ||
pull_request: | ||
branches: ["main"] | ||
|
||
permissions: | ||
actions: read | ||
contents: write | ||
statuses: read | ||
|
||
env: | ||
TF_VAR_github_app_id: ${{ secrets.GH_APP_ID }} | ||
TF_VAR_github_app_install_id: ${{ secrets.GH_APP_INSTALL_ID }} | ||
TF_VAR_github_app_private_key: ${{ secrets.GH_APP_KEY }} | ||
TF_VAR_labels: '["test", "${{ github.run_id }}"]' | ||
|
||
jobs: | ||
lint: | ||
name: Lint | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
directory: | ||
- "." | ||
- "examples/full" | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
- name: Lint Example | ||
uses: "infinite-automations/tflint-all-in-one@v1.0.0" | ||
with: | ||
directory: ${{ matrix.directory }} | ||
|
||
update-docs: | ||
name: Update Docs | ||
needs: | ||
- lint | ||
runs-on: ubuntu-latest | ||
concurrency: | ||
group: ${{ github.ref }}-docs | ||
cancel-in-progress: false | ||
outputs: | ||
changed: ${{ steps.terraform-docs.outputs.num_changed > 0 }} | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
if: ${{ github.event_name == 'push' }} | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
if: ${{ github.event_name == 'pull_request' }} | ||
with: | ||
ref: ${{ github.event.pull_request.head.ref }} | ||
- name: Render terraform docs inside the README.md | ||
id: terraform-docs | ||
uses: terraform-docs/gh-actions@v1.0.0 | ||
with: | ||
working-dir: .,examples/full | ||
output-file: README.md | ||
output-method: inject | ||
git-push: ${{ github.event_name == 'pull_request' }} | ||
git-commit-message: "docs(terraform): update README.md" | ||
- name: Cache Docs | ||
if: ${{ github.event_name == 'push' }} | ||
uses: actions/cache@v3 | ||
with: | ||
path: | | ||
README.md | ||
examples/full/README.md | ||
key: ${{ runner.os }}-docs-${{ github.sha }} | ||
|
||
setup-runner: | ||
name: Setup Runner | ||
needs: | ||
- lint | ||
- update-docs | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
- name: Create k8s Kind Cluster | ||
uses: helm/kind-action@v1.8.0 | ||
with: | ||
wait: "120s" | ||
- name: Create Runners | ||
uses: infinite-automations/terraform-all-in-one@v1.2.0 | ||
id: apply-example | ||
with: | ||
directory: "examples/full" | ||
plan: false | ||
apply: true | ||
destroy: false | ||
- name: Wait For Test | ||
uses: yogeshlonkar/wait-for-jobs@v0 | ||
with: | ||
gh-token: ${{ secrets.GITHUB_TOKEN }} | ||
jobs: "Test" | ||
prefix: true | ||
ttl: "10" | ||
- name: Destroy Runners | ||
uses: infinite-automations/terraform-all-in-one@v1.2.0 | ||
if: always() | ||
with: | ||
directory: "examples/full" | ||
plan: false | ||
apply: false | ||
destroy: true | ||
destroy-args: '-target="kubectl_manifest.runner"' | ||
|
||
test-runner: | ||
name: Test | ||
needs: | ||
- lint | ||
- update-docs | ||
runs-on: | ||
- self-hosted | ||
- test | ||
- ${{ github.run_id }} | ||
strategy: | ||
matrix: | ||
image: | ||
- alpine:latest | ||
- ubuntu:latest | ||
- debian:latest | ||
container: | ||
image: ${{ matrix.image }} | ||
timeout-minutes: 10 | ||
steps: | ||
- name: Print Environment Information | ||
run: | | ||
echo "Operating System: $OSTYPE" | ||
echo "Hostname: $(hostname)" | ||
echo "CPU Architecture: $(uname -m)" | ||
echo "Kernel Version: $(uname -r)" | ||
echo | ||
cat /etc/os-release | ||
release: | ||
name: Release | ||
needs: | ||
- update-docs | ||
- setup-runner | ||
- test-runner | ||
concurrency: | ||
group: ${{ github.ref }}-release | ||
cancel-in-progress: false | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
- name: Restore Cached Docs | ||
if: ${{ github.event_name == 'push' }} | ||
uses: actions/cache@v3 | ||
with: | ||
path: README.md | ||
key: ${{ runner.os }}-docs-${{ github.sha }} | ||
- name: Semantic Release | ||
uses: cycjimmy/semantic-release-action@v4 | ||
with: | ||
dry_run: ${{ github.event_name == 'pull_request' }} | ||
ci: true | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
{ | ||
"branches": [ | ||
"main" | ||
], | ||
"tagFormat": "${version}", | ||
"plugins": [ | ||
"@semantic-release/commit-analyzer", | ||
"@semantic-release/release-notes-generator", | ||
[ | ||
"@semantic-release/changelog", | ||
{ | ||
"changelogFile": "CHANGELOG.md" | ||
} | ||
], | ||
[ | ||
"@semantic-release/git", | ||
{ | ||
"message": "chore(release): ${nextRelease.version} [skip ci]\n\n${nextRelease.notes}", | ||
"assets": [ | ||
"CHANGELOG.md", | ||
"README.md", | ||
"examples/full/README.md" | ||
] | ||
} | ||
], | ||
"@semantic-release/github" | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
# .terraform-docs.yml | ||
formatter: "markdown table" | ||
|
||
sections: | ||
show: | ||
- header | ||
- requirements | ||
- providers | ||
- resources | ||
- inputs | ||
- outputs | ||
- footer | ||
|
||
content: |- | ||
{{ .Header }} | ||
## Module Usage | ||
```hcl | ||
{{ include "examples/full/main.tf" }} | ||
``` | ||
{{ .Requirements }} | ||
{{ .Providers }} | ||
{{ .Resources }} | ||
{{ .Inputs }} | ||
{{ .Outputs }} | ||
{{ .Footer }} | ||
sort: | ||
enabled: true | ||
by: required | ||
|
||
settings: | ||
anchor: true | ||
default: true | ||
required: true | ||
type: true | ||
hide-empty: true | ||
indent: 2 |
Oops, something went wrong.