feat: add go-task, set up prettier, format yaml (#50)
This commit is contained in:
1 parent
99370f6d8d
commit
525be88214
21 files changed
+185
-50
No files matched your search
@@ -0,0 +1,23 @@
|
||||
---
|
||||
default: true
|
||||
|
||||
# MD013/line-length - Line length
|
||||
MD013:
|
||||
# Number of characters
|
||||
line_length: 240
|
||||
# Number of characters for headings
|
||||
heading_line_length: 80
|
||||
# Number of characters for code blocks
|
||||
code_block_line_length: 80
|
||||
# Include code blocks
|
||||
code_blocks: true
|
||||
# Include tables
|
||||
tables: true
|
||||
# Include headings
|
||||
headings: true
|
||||
# Include headings
|
||||
headers: true
|
||||
# Strict length checking
|
||||
strict: false
|
||||
# Stern length checking
|
||||
stern: false
|
||||
@@ -0,0 +1,2 @@
|
||||
*.sops.yaml
|
||||
gotk-components.yaml
|
||||
@@ -0,0 +1,5 @@
|
||||
---
|
||||
trailingComma: "es5"
|
||||
tabWidth: 2
|
||||
semi: false
|
||||
singleQuote: false
|
||||
@@ -1,10 +1,10 @@
|
||||
ignore: |
|
||||
.github/
|
||||
crds.yaml
|
||||
*.sops.yaml
|
||||
gotk-components.yaml
|
||||
extends: default
|
||||
rules:
|
||||
truthy:
|
||||
allowed-values: ['true', 'false', 'on', 'yes']
|
||||
allowed-values: ["true", "false", "on"]
|
||||
comments:
|
||||
min-spaces-from-content: 1
|
||||
line-length: disable
|
||||
@@ -14,6 +14,4 @@ rules:
|
||||
brackets:
|
||||
min-spaces-inside: 0
|
||||
max-spaces-inside: 0
|
||||
indentation:
|
||||
spaces: 2
|
||||
indent-sequences: consistent
|
||||
indentation: enable
|
||||
@@ -1,11 +1,10 @@
|
||||
---
|
||||
|
||||
name: Schedule - Update Flux
|
||||
|
||||
on: # yamllint disable-line rule:truthy
|
||||
workflow_dispatch:
|
||||
schedule:
|
||||
- cron: '0 12 * * *'
|
||||
- cron: "0 12 * * *"
|
||||
|
||||
jobs:
|
||||
flux-upgrade:
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
---
|
||||
|
||||
name: Invalid Template
|
||||
|
||||
on:
|
||||
@@ -16,9 +15,9 @@ jobs:
|
||||
- uses: dessant/support-requests@v2
|
||||
with:
|
||||
github-token: ${{ github.token }}
|
||||
support-label: 'template-incomplete'
|
||||
support-label: "template-incomplete"
|
||||
issue-comment: >
|
||||
:wave: @{issue-author}, please follow the template provided.
|
||||
close-issue: true
|
||||
lock-issue: true
|
||||
issue-lock-reason: 'resolved'
|
||||
issue-lock-reason: "resolved"
|
||||
@@ -1,19 +1,32 @@
|
||||
---
|
||||
|
||||
name: Lint
|
||||
|
||||
on: # yamllint disable-line rule:truthy
|
||||
workflow_dispatch:
|
||||
pull_request:
|
||||
|
||||
jobs:
|
||||
yaml:
|
||||
yamllint:
|
||||
runs-on: ubuntu-20.04
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: yamllint
|
||||
uses: reviewdog/action-yamllint@v1
|
||||
with:
|
||||
github_token: ${{ secrets.github_token }}
|
||||
reporter: github-pr-review
|
||||
yamllint_flags: '-c .github/yamllint.config.yaml ./cluster/'
|
||||
yamllint_flags: "-c .github/lint/.yamllint.yaml ./cluster"
|
||||
shellcheck:
|
||||
runs-on: ubuntu-20.04
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: shellcheck
|
||||
uses: reviewdog/action-shellcheck@v1
|
||||
with:
|
||||
path: "./hack"
|
||||
level: "error"
|
||||
markdownlint:
|
||||
runs-on: ubuntu-20.04
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: markdownlint
|
||||
uses: reviewdog/action-markdownlint@v0.2
|
||||
with:
|
||||
github_token: ${{ secrets.GITHUB_TOKEN }}
|
||||
@@ -1,12 +1,10 @@
|
||||
|
||||
---
|
||||
|
||||
name: Schedule - Renovate Helm Releases
|
||||
|
||||
on: # yamllint disable-line rule:truthy
|
||||
workflow_dispatch:
|
||||
schedule:
|
||||
- cron: '0 */12 * * *'
|
||||
- cron: "0 */12 * * *"
|
||||
|
||||
jobs:
|
||||
renovate-helm-releases:
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
---
|
||||
|
||||
name: 'Support requests'
|
||||
name: "Support requests"
|
||||
|
||||
on:
|
||||
issues:
|
||||
@@ -16,7 +15,7 @@ jobs:
|
||||
- uses: dessant/support-requests@v2
|
||||
with:
|
||||
github-token: ${{ secrets.GITHUB_TOKEN }}
|
||||
support-label: 'support'
|
||||
support-label: "support"
|
||||
issue-comment: >
|
||||
:wave: @{issue-author}, we use the issue tracker exclusively
|
||||
for bug reports and feature requests. However, this issue appears
|
||||
@@ -25,4 +24,4 @@ jobs:
|
||||
- [Discord](https://discord.gg/sTMX7Vh)
|
||||
close-issue: true
|
||||
lock-issue: false
|
||||
issue-lock-reason: 'off-topic'
|
||||
issue-lock-reason: "off-topic"
|
||||
@@ -1,11 +1,12 @@
|
||||
---
|
||||
fail_fast: false
|
||||
repos:
|
||||
- repo: https://github.com/adrienverge/yamllint
|
||||
rev: v1.26.2
|
||||
hooks:
|
||||
- args:
|
||||
- -c
|
||||
- .github/yamllint.config.yaml
|
||||
- --config-file
|
||||
- .github/lint/.yamllint.yaml
|
||||
id: yamllint
|
||||
- repo: https://github.com/pre-commit/pre-commit-hooks
|
||||
rev: v4.0.1
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
---
|
||||
version: "3"
|
||||
|
||||
tasks:
|
||||
sync:
|
||||
desc: Sync flux-system with the Git Repository
|
||||
cmds:
|
||||
- flux reconcile source git flux-system
|
||||
silent: true
|
||||
@@ -0,0 +1,33 @@
|
||||
---
|
||||
version: "3"
|
||||
|
||||
tasks:
|
||||
all:
|
||||
- task: markdown
|
||||
- task: yaml
|
||||
markdown:
|
||||
desc: Format Markdown
|
||||
cmds:
|
||||
- >-
|
||||
prettier
|
||||
--ignore-path '.github/lint/.prettierignore'
|
||||
--config '.github/lint/.prettierrc.yaml'
|
||||
--list-different
|
||||
--ignore-unknown
|
||||
--parser=markdown
|
||||
--write '*.md' '**/*.md'
|
||||
ignore_error: true
|
||||
yaml:
|
||||
desc: Format YAML
|
||||
cmds:
|
||||
- >-
|
||||
prettier
|
||||
--ignore-path '.github/lint/.prettierignore'
|
||||
--config
|
||||
'.github/lint/.prettierrc.yaml'
|
||||
--list-different
|
||||
--ignore-unknown
|
||||
--parser=yaml
|
||||
--write '*.y*ml'
|
||||
'**/*.y*ml'
|
||||
ignore_error: true
|
||||
@@ -0,0 +1,26 @@
|
||||
---
|
||||
version: "3"
|
||||
|
||||
tasks:
|
||||
all:
|
||||
- task: markdown
|
||||
- task: yaml
|
||||
- task: format
|
||||
|
||||
markdown:
|
||||
desc: Lint Markdown
|
||||
cmds:
|
||||
- markdownlint -c '.github/lint/.markdownlint.yaml' *.md **/*.md
|
||||
ignore_errors: true
|
||||
|
||||
yaml:
|
||||
desc: Lint YAML
|
||||
cmds:
|
||||
- yamllint -c '.github/lint/.yamllint.yaml' .
|
||||
ignore_errors: true
|
||||
|
||||
format:
|
||||
desc: Lint general formatting
|
||||
cmds:
|
||||
- prettier --ignore-path '.github/lint/.prettierignore' --config '.github/lint/.prettierrc.yaml' --check .
|
||||
ignore_errors: true
|
||||
@@ -0,0 +1,12 @@
|
||||
---
|
||||
version: "3"
|
||||
|
||||
tasks:
|
||||
init:
|
||||
desc: Initialize pre-commit hooks
|
||||
cmds:
|
||||
- pre-commit install-hooks
|
||||
run:
|
||||
desc: Run pre-commit
|
||||
cmds:
|
||||
- pre-commit run --all-files
|
||||
@@ -50,6 +50,8 @@ Already provisioned Bare metal or VMs with any modern operating system like Ubun
|
||||
| [pre-commit](https://github.com/pre-commit/pre-commit) | Runs checks during `git commit` | `2.12.0` | ❌ |
|
||||
| [kustomize](https://kustomize.io/) | Template-free way to customize application configuration | `4.1.0` | ❌ |
|
||||
| [helm](https://helm.sh/) | Manage Kubernetes applications | `3.5.4` | ❌ |
|
||||
| [go-task](https://github.com/go-task/task) | A task runner / simpler Make alternative written in Go | `3.7.0` | ❌ |
|
||||
| [prettier](https://github.com/prettier/prettier) | Prettier is an opinionated code formatter. | `2.3.2` | ❌ |
|
||||
|
||||
### :warning: pre-commit
|
||||
|
||||
@@ -252,23 +254,23 @@ export BOOTSTRAP_INGRESS_NGINX_LB="169.254.1.10"
|
||||
|
||||
```sh
|
||||
envsubst < ./tmpl/.sops.yaml > ./.sops.yaml
|
||||
envsubst < ./tmpl/cluster-secrets.yaml > ./cluster/base/cluster-secrets.yaml
|
||||
envsubst < ./tmpl/cluster-secrets.sops.yaml > ./cluster/base/cluster-secrets.sops.yaml
|
||||
envsubst < ./tmpl/cluster-settings.yaml > ./cluster/base/cluster-settings.yaml
|
||||
envsubst < ./tmpl/gotk-sync.yaml > ./cluster/base/flux-system/gotk-sync.yaml
|
||||
envsubst < ./tmpl/secret.enc.yaml > ./cluster/core/cert-manager/secret.enc.yaml
|
||||
envsubst < ./tmpl/secret.sops.yaml > ./cluster/core/cert-manager/secret.sops.yaml
|
||||
```
|
||||
|
||||
6. **Verify** all the above files have the correct information present
|
||||
|
||||
7. Encrypt `cluster/cluster-secrets.yaml` and `cert-manager/secret.enc.yaml` with SOPS
|
||||
7. Encrypt `cluster/cluster-secrets.sops.yaml` and `cert-manager/secret.sops.yaml` with SOPS
|
||||
|
||||
```sh
|
||||
export GPG_TTY=$(tty)
|
||||
sops --encrypt --in-place ./cluster/base/cluster-secrets.yaml
|
||||
sops --encrypt --in-place ./cluster/core/cert-manager/secret.enc.yaml
|
||||
sops --encrypt --in-place ./cluster/base/cluster-secrets.sops.yaml
|
||||
sops --encrypt --in-place ./cluster/core/cert-manager/secret.sops.yaml
|
||||
```
|
||||
|
||||
:round_pushpin: Variables defined in `cluster-secrets.yaml` and `cluster-settings.yaml` will be usable anywhere in your YAML manifests under `./cluster`
|
||||
:round_pushpin: Variables defined in `cluster-secrets.sops.yaml` and `cluster-settings.sops.yaml` will be usable anywhere in your YAML manifests under `./cluster`
|
||||
|
||||
8. **Verify** all the above files are **encrypted** with SOPS
|
||||
|
||||
|
||||
@@ -0,0 +1,16 @@
|
||||
---
|
||||
version: "3"
|
||||
|
||||
vars:
|
||||
PROJECT_DIR:
|
||||
sh: "git rev-parse --show-toplevel"
|
||||
CLUSTER_DIR: "{{.PROJECT_DIR}}/cluster"
|
||||
|
||||
env:
|
||||
KUBECONFIG: "{{.PROJECT_DIR}}/kubeconfig"
|
||||
|
||||
includes:
|
||||
flux: .taskfiles/flux.yml
|
||||
format: .taskfiles/format.yml
|
||||
lint: .taskfiles/lint.yml
|
||||
pre-commit: .taskfiles/pre-commit.yml
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
---
|
||||
creation_rules:
|
||||
- encrypted_regex: '^(data|stringData)$'
|
||||
- encrypted_regex: "^(data|stringData)$"
|
||||
pgp: >-
|
||||
${FLUX_KEY_FP},
|
||||
${PERSONAL_KEY_FP}
|
||||
@@ -0,0 +1,9 @@
|
||||
# yamllint disable
|
||||
apiVersion: v1
|
||||
kind: Secret
|
||||
metadata:
|
||||
name: cluster-secrets
|
||||
namespace: flux-system
|
||||
stringData:
|
||||
SECRET_DOMAIN: ${BOOTSTRAP_DOMAIN}
|
||||
SECRET_CLOUDFLARE_EMAIL: ${BOOTSTRAP_CLOUDFLARE_EMAIL}
|
||||
@@ -1,9 +0,0 @@
|
||||
# yamllint disable
|
||||
apiVersion: v1
|
||||
kind: Secret
|
||||
metadata:
|
||||
name: cluster-secrets
|
||||
namespace: flux-system
|
||||
stringData:
|
||||
SECRET_DOMAIN: ${BOOTSTRAP_DOMAIN}
|
||||
SECRET_CLOUDFLARE_EMAIL: ${BOOTSTRAP_CLOUDFLARE_EMAIL}
|
||||
@@ -1,8 +0,0 @@
|
||||
# yamllint disable
|
||||
apiVersion: v1
|
||||
kind: Secret
|
||||
metadata:
|
||||
name: cloudflare-token-secret
|
||||
namespace: cert-manager
|
||||
stringData:
|
||||
cloudflare-token: ${BOOTSTRAP_CLOUDFLARE_TOKEN}
|
||||
@@ -0,0 +1,8 @@
|
||||
# yamllint disable
|
||||
apiVersion: v1
|
||||
kind: Secret
|
||||
metadata:
|
||||
name: cloudflare-token-secret
|
||||
namespace: cert-manager
|
||||
stringData:
|
||||
cloudflare-token: ${BOOTSTRAP_CLOUDFLARE_TOKEN}
|
||||
Reference in new issue
Block a user