Skip to content

Commit

Permalink
#636 Helm Integration
Browse files Browse the repository at this point in the history
#636 Helm Integration
  • Loading branch information
CREITZ25 committed Mar 7, 2022
1 parent 045440e commit 3c041d2
Show file tree
Hide file tree
Showing 5 changed files with 104 additions and 0 deletions.
1 change: 1 addition & 0 deletions documentation/cli.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ The following commandlets are currently available:
* link:docker.asciidoc[docker]
* link:eclipse.asciidoc[eclipse]
* link:gradle.asciidoc[gradle]
* link:helm.asciidoc[helm]
* link:help.asciidoc[help]
* link:ide.asciidoc[ide]
* link:intellij.asciidoc[intellij]
Expand Down
2 changes: 2 additions & 0 deletions documentation/devonfw-ide-usage.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ include::eclipse.asciidoc[leveloffset=3]

include::gradle.asciidoc[leveloffset=3]

include::helm.asciidoc[leveloffset=3]

include::help.asciidoc[leveloffset=3]

include::ide.asciidoc[leveloffset=3]
Expand Down
23 changes: 23 additions & 0 deletions documentation/helm.asciidoc
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."
|=======================
1 change: 1 addition & 0 deletions documentation/scripts.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ This directory is the heart of the `devonfw-ide` and contains the required link:
│ ├── link:docker.asciidoc[docker]
│ ├── link:eclipse.asciidoc[eclipse]
│ ├── link:gradle.asciidoc[gradle]
| ├── link:helm.asciidoc[helm]
│ ├── link:help.asciidoc[help]
│ ├── link:ide.asciidoc[ide]
│ ├── link:intellij.asciidoc[intellij]
Expand Down
77 changes: 77 additions & 0 deletions scripts/src/main/resources/scripts/command/helm
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

0 comments on commit 3c041d2

Please sign in to comment.