Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
christianhuth committed Dec 17, 2024
1 parent 0d94c2d commit d361510
Show file tree
Hide file tree
Showing 5 changed files with 40 additions and 9 deletions.
6 changes: 6 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,18 @@
"customizations": {
"vscode": {
"extensions": [
"github.vscode-github-actions",
"ms-kubernetes-tools.vscode-kubernetes-tools",
"tim-koehler.helm-intellisense"
]
}
},

"mounts": [
"type=bind,source=${localEnv:HOME}/.ssh,target=/home/vscode/.ssh,readonly"
],

// we use /home/vscode/helm-charts as development folder inside the container
"workspaceFolder": "/home/vscode/helm-charts",
"workspaceMount": "source=${localWorkspaceFolder},target=/home/vscode/helm-charts,type=bind"

Expand Down
3 changes: 3 additions & 0 deletions .git-hooks/helm-dependency-update.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/bash

ct list-changed | xargs -d '\n' -I {} helm dependency update {}
14 changes: 9 additions & 5 deletions .github/workflows/chart-testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,15 @@ jobs:
- name: setup helm
uses: azure/setup-helm@v3

- name: Update dependencies
run: find charts/ ! -path charts/ -maxdepth 1 -type d -exec helm dependency update {} \;
- uses: actions/setup-python@v5
with:
python-version: 3.7

- name: Set up chart-testing
uses: helm/[email protected]

- name: helm linting
run : helm lint charts/*
- name: helm lint on changed charts
run : ct list-changed --config .github/config/chart-testing.yaml | xargs -d '\n' -I {} helm dependency update {}

chart-testing:
runs-on: ubuntu-22.04
Expand All @@ -63,7 +67,7 @@ jobs:
- name: Run chart-testing (list-changed)
id: list-changed
run: |
changed=$(ct list-changed --target-branch ${{ github.event.repository.default_branch }})
changed=$(ct list-changed --config .github/config/chart-testing.yaml)
if [[ -n "$changed" ]]; then
echo "::set-output name=changed::true"
fi
Expand Down
15 changes: 11 additions & 4 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,14 @@ repos:
args:
- --chart-search-root=charts

- repo: https://github.com/gruntwork-io/pre-commit
rev: v0.1.25
hooks:
- id: helmlint
# - repo: https://github.com/igorshubovych/markdownlint-cli
# rev: v0.32.2
# hooks:
# - id: markdownlint
# name: Markdownlint

# - repo: https://github.com/jumanjihouse/pre-commit-hooks
# rev: 3.0.0
# hooks:
# - id: shellcheck
# name: Shellcheck
11 changes: 11 additions & 0 deletions .pre-commit-hooks.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
- id: helm-dependency-update
name: Update Helm Dependency for changed Charts
entry: bash -c 'ct list-changed | xargs -d '\n' -I {} helm dependency update {}'
language: system
pass_filenames: false

- id: helm-kubeconform
name: Execute kubeconform for changed Charts
entry: bash -c 'ct list-changed | xargs -d '\n' -I {} helm kubeconform {}'
language: system
pass_filenames: false

0 comments on commit d361510

Please sign in to comment.