-
Notifications
You must be signed in to change notification settings - Fork 102
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
#636 Helm Integration
- Loading branch information
Showing
5 changed files
with
104 additions
and
0 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,23 @@ | ||
:toc: | ||
toc::[] | ||
|
||
= Helm | ||
|
||
The helm commandlet allows to install and use https://www.helm.sh/[Helm]. | ||
|
||
*ATTENTION:* | ||
Currently this feature is new and therefore experimental. | ||
It may change in incompatible ways in the next releases until we reach a stable state. | ||
We hope that all is working fine for you. | ||
However, do not expect everything to work out of the box. | ||
In case you are facing issues (e.g. network problems with Cisco AnyConnect, etc.) please give us feedback so we can improve. | ||
|
||
The arguments (`devon helm «args»`) are explained by the following table: | ||
|
||
.Usage of `devon helm` | ||
[options="header"] | ||
|======================= | ||
|*Argument(s)* |*Meaning* | ||
|`setup` |install helm on your machine. | ||
|`«args»` |call helm with the specified arguments. Call `helm --help` for details or use helm directly as preferred." | ||
|======================= |
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,77 @@ | ||
#!/usr/bin/env bash | ||
|
||
# autocompletion list | ||
if [ "${1}" = "shortlist" ] | ||
then | ||
if [ -z "${2}" ] | ||
then | ||
echo "setup help" | ||
fi | ||
exit | ||
fi | ||
|
||
if [ -n "${DEVON_IDE_TRACE}" ]; then set -vx; fi | ||
# shellcheck source=scripts/functions | ||
source "$(dirname "${0}")"/../functions | ||
|
||
# Check if helm is installed. | ||
function doIsHelmInstalled() { | ||
if command -v helm &> /dev/null | ||
then | ||
return | ||
else | ||
return 255 | ||
fi | ||
} | ||
|
||
# Call helm with specified arguments. | ||
function doRun() { | ||
doSetup silent | ||
helm "${@}" | ||
} | ||
|
||
function doSetup() { | ||
|
||
if doIsHelmInstalled | ||
then | ||
if [ "${1}" != "silent" ] && ! doIsQuiet | ||
then | ||
helm version | ||
fi | ||
else | ||
# Check if HELM_HOME is already set | ||
if [ -z "${HELM_HOME}" ] | ||
then | ||
HELM_HOME="${DEVON_IDE_HOME}/software/helm" | ||
fi | ||
|
||
# Get leatest release | ||
if [ -z "${HELM_VERSION}" ] | ||
then | ||
doEcho "Getting latest release..." | ||
HELM_VERSION=$(curl -LsH "Accept: application/vnd.github.v3+json" https://api.github.com/repos/helm/helm/releases/latest | awk -F':' '/tag_name/ {print $2}' | awk -F'"' '{print $2}') | ||
fi | ||
|
||
doInstall "-" "${HELM_HOME}" "helm" "${HELM_VERSION}" | ||
fi | ||
} | ||
|
||
|
||
# CLI | ||
case ${1} in | ||
"help" | "-h") | ||
echo "Install helm." | ||
echo | ||
echo "Arguments:" | ||
echo " setup install helm on your machine." | ||
echo " <<args>> call helm with the specified arguments. Call helm --help for details or use helm directly as preferred." | ||
echo | ||
;; | ||
"setup" | "s" | "") | ||
doEcho "Installating helm..." | ||
doSetup | ||
;; | ||
*) | ||
doRun "${@}" | ||
;; | ||
esac |