generated from ministryofjustice/template-repository
-
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.
🗺️ Add Helm and Helm Chart Testing (#59)
Signed-off-by: Jacob Woffenden <jacob.woffenden@digital.justice.gov.uk>
- Loading branch information
Jacob Woffenden
authored
Apr 16, 2024
1 parent
8429479
commit a11567c
Showing
7 changed files
with
103 additions
and
2 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
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 |
---|---|---|
@@ -0,0 +1,34 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -e | ||
|
||
# shellcheck source=/dev/null | ||
# file not accessible until being built | ||
source /usr/local/bin/devcontainer-utils | ||
|
||
get_system_architecture | ||
|
||
GITHUB_REPOSITORY="helm/helm" | ||
VERSION="${HELMCLIVERSION:-"latest"}" | ||
|
||
if [[ "${VERSION}" == "latest" ]]; then | ||
get_github_latest_tag "${GITHUB_REPOSITORY}" | ||
VERSION="${GITHUB_LATEST_TAG}" | ||
VERSION_STRIP_V="${GITHUB_LATEST_TAG_STRIP_V}" | ||
else | ||
# shellcheck disable=SC2034 | ||
VERSION_STRIP_V="${VERSION#v}" | ||
fi | ||
|
||
curl --fail-with-body --location "https://get.helm.sh/helm-${VERSION}-linux-${ARCHITECTURE}.tar.gz" \ | ||
--output "helm-${VERSION}-linux-${ARCHITECTURE}.tar.gz" | ||
|
||
tar --extract --file "helm-${VERSION}-linux-${ARCHITECTURE}.tar.gz" | ||
|
||
install --owner=vscode --group=vscode --mode=775 "linux-${ARCHITECTURE}/helm" /usr/local/bin/helm | ||
|
||
install --directory --owner=vscode --group=vscode /home/vscode/.config/helm | ||
|
||
install --owner=vscode --group=vscode --mode=775 "$(dirname "${0}")"/src/home/vscode/.devcontainer/featurerc.d/helm.sh /home/vscode/.devcontainer/featurerc.d/helm.sh | ||
|
||
rm --recursive --force "linux-${ARCHITECTURE}" "helm-${VERSION}-linux-${ARCHITECTURE}.tar.gz" |
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,36 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -e | ||
|
||
# shellcheck source=/dev/null | ||
# file not accessible until being built | ||
source /usr/local/bin/devcontainer-utils | ||
|
||
get_system_architecture | ||
|
||
GITHUB_REPOSITORY="helm/chart-testing" | ||
VERSION="${HELMCTCLIVERSION:-"latest"}" | ||
|
||
if [[ "${VERSION}" == "latest" ]]; then | ||
get_github_latest_tag "${GITHUB_REPOSITORY}" | ||
VERSION="${GITHUB_LATEST_TAG}" | ||
VERSION_STRIP_V="${GITHUB_LATEST_TAG_STRIP_V}" | ||
else | ||
# shellcheck disable=SC2034 | ||
VERSION_STRIP_V="${VERSION#v}" | ||
fi | ||
|
||
curl --fail-with-body --location "https://github.com/helm/chart-testing/releases/download/${VERSION}/chart-testing_${VERSION_STRIP_V}_linux_${ARCHITECTURE}.tar.gz" \ | ||
--output "chart-testing_${VERSION_STRIP_V}_linux_${ARCHITECTURE}.tar.gz" | ||
|
||
tar --extract --file "chart-testing_${VERSION_STRIP_V}_linux_${ARCHITECTURE}.tar.gz" | ||
|
||
install --owner=vscode --group=vscode --mode=775 ct /usr/local/bin/ct | ||
|
||
install --directory --owner=vscode --group=vscode /home/vscode/.ct | ||
|
||
install --owner=vscode --group=vscode --mode=644 etc/chart_schema.yaml /home/vscode/.ct/chart_schema.yaml | ||
|
||
install --owner=vscode --group=vscode --mode=644 etc/lintconf.yaml /home/vscode/.ct/lintconf.yaml | ||
|
||
rm --recursive --force ct LICENSE README.md etc/chart_schema.yaml etc/lintconf.yaml "chart-testing_${VERSION_STRIP_V}_linux_${ARCHITECTURE}.tar.gz" |
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
4 changes: 4 additions & 0 deletions
4
features/src/kubernetes/src/home/vscode/.devcontainer/featurerc.d/helm.sh
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,4 @@ | ||
#!/usr/bin/env bash | ||
|
||
# shellcheck disable=SC1090 | ||
source <(helm completion zsh) |
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