Skip to content

Commit

Permalink
updated pre-commit-config and devcontainer spec
Browse files Browse the repository at this point in the history
  • Loading branch information
christianhuth committed Dec 17, 2024
1 parent e44beb6 commit 613ed69
Show file tree
Hide file tree
Showing 3 changed files with 44 additions and 5 deletions.
27 changes: 22 additions & 5 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,24 +3,41 @@

"name": "helm-charts-development",

"image": "mcr.microsoft.com/devcontainers/base:bullseye",
"image": "mcr.microsoft.com/devcontainers/base:ubuntu-22.04",

"containerEnv": {
"HOME": "/home/vscode",
"SHELL": "/bin/bash"
},

// Features to add to the dev container. More info: https://containers.dev/features.
"features": {
"ghcr.io/devcontainers/features/docker-outside-of-docker:1": {},
"ghcr.io/devcontainers/features/kubectl-helm-minikube:1": {
"version": "latest",
"helm": "latest",
"minikube": "latest"
},
"ghcr.io/devcontainers-extra/features/pre-commit:2": {},
"ghcr.io/dirsigler/devcontainer-features/helm-docs:1": {},
"ghcr.io/devcontainers-contrib/features/pre-commit:2": {},
"ghcr.io/mpriscella/features/helm-chart-testing:1": {}
},

// 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",
"postCreateCommand": "/bin/bash .devcontainer/postCreateCommand.sh",

"remoteUser": "vscode",

"remoteUser": "christianhuth"
// Configure tool-specific properties.
"customizations": {
"vscode": {
"extensions": [
"ms-kubernetes-tools.vscode-kubernetes-tools",
"tim-koehler.helm-intellisense"
]
}
}

}
15 changes: 15 additions & 0 deletions .devcontainer/postCreateCommand.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!/bin/bash

# install pre-commit hooks
pre-commit install --install-hooks

# set up autocompletion
TEMP_COMPLETION_FOLDER="${HOME}/bash_completion.d"
COMPLETION_FOLDER="/etc/bash_completion.d"
mkdir -p ${TEMP_COMPLETION_FOLDER}
BINARIES=("ct")
for binary in "${BINARIES[@]}"
do
$binary completion bash > ${TEMP_COMPLETION_FOLDER}/$binary
sudo mv ${TEMP_COMPLETION_FOLDER}/$binary ${COMPLETION_FOLDER}/$binary
done
7 changes: 7 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,10 @@ repos:
- id: check-yaml
args: [--allow-multiple-documents]
exclude: ^charts/.*/templates/
- repo: https://github.com/norwoodj/helm-docs
rev: ""
hooks:
- id: helm-docs-container
entry: jnorwood/helm-docs:v1.14.2
args:
- --chart-search-root=charts

0 comments on commit 613ed69

Please sign in to comment.