-
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.
feat: add yaml and tf lint, publish kustomizations via OCI. Will stil…
…l need to refactor at a future date
- Loading branch information
Showing
12 changed files
with
124 additions
and
6 deletions.
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,17 @@ | ||
name: Lint TF files | ||
on: | ||
pull_request: | ||
paths: | ||
- '**.tf' | ||
branches: | ||
- main | ||
|
||
jobs: | ||
lint-tf: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: terraform-linters/[email protected] | ||
with: | ||
tflint_version: v0.45.0 | ||
- run: make lint-tf |
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,16 @@ | ||
name: Lint YAML files | ||
on: | ||
pull_request: | ||
paths: | ||
- '**.yaml' | ||
- '**.yml' | ||
branches: | ||
- main | ||
|
||
jobs: | ||
lint-yaml: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- run: sudo apt-get install -y yamllint | ||
- run: make lint-yaml |
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,26 @@ | ||
name: publish-kustomizations | ||
on: | ||
push: | ||
branches: | ||
- main | ||
paths: | ||
- gitops/** | ||
- '!**/*.md' | ||
jobs: | ||
publish-kustomizations: | ||
runs-on: ubuntu-latest | ||
permissions: | ||
packages: write | ||
contents: read | ||
env: | ||
IMAGE: "ghcr.io/pelotech/kustomizations/foundation:0.0.1" | ||
GITHUB_ACTOR: ${{ github.actor }} | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: oras-project/setup-oras@v1 | ||
- name: publish | ||
run: | | ||
tar -cf foundation.tar gitops/ | ||
oras login ghcr.io -u $GITHUB_ACTOR -p $GITHUB_TOKEN | ||
oras push ${IMAGE} foundation.tar |
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,5 @@ | ||
plugin "aws" { | ||
enabled = true | ||
version = "0.22.1" | ||
source = "github.com/terraform-linters/tflint-ruleset-aws" | ||
} |
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,12 @@ | ||
extends: relaxed | ||
|
||
rules: | ||
line-length: disable | ||
commas: disable | ||
indentation: | ||
spaces: 2 | ||
indent-sequences: whatever | ||
|
||
ignore: | | ||
*.terraform/ | ||
gitops/base-install/cert-manager/create-issuer/templates/create-issuer.yaml |
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,17 @@ | ||
.PHONY: lint | ||
lint: lint-tf lint-yaml | ||
|
||
# TODO: fail on exit 1 but not 2 | ||
.PHONY: lint-tf | ||
lint-tf: | ||
tflint --init | ||
tflint --recursive || echo "Temp bypass and need to figure out warnings" | ||
|
||
|
||
.PHONY: lint-yaml | ||
lint-yaml: | ||
yamllint -c .yamllint . | ||
|
||
.PHONY: format | ||
format: | ||
terraform fmt -recursive |
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,17 @@ | ||
apiVersion: backstage.io/v1alpha1 | ||
kind: Component | ||
metadata: | ||
name: foundation | ||
description: Foundation is the opinionated approach to k8s cluster setup | ||
tags: | ||
- kustomize | ||
- helm | ||
- terraform | ||
- k8s | ||
annotations: | ||
github.com/project-slug: pelotech/foundation | ||
backstage.io/techdocs-ref: dir:. | ||
spec: | ||
type: infrastructure | ||
lifecycle: production | ||
owner: leads |
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
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 |
---|---|---|
|
@@ -16,4 +16,3 @@ patches: | |
value: | ||
namespace: nidhogg-system | ||
server: https://kubernetes.default.svc | ||
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
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 |
---|---|---|
|
@@ -12,4 +12,3 @@ spec: | |
command: | ||
- cat | ||
- /host/etc/cni/net.d/10-aws.conflist | ||
|
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,5 @@ | ||
site_name: foundation | ||
site_description: foundation project documentation | ||
|
||
plugins: | ||
- techdocs-core |