From a3513ed479337a5cfde6c6f91eb112c1b675ac0b Mon Sep 17 00:00:00 2001 From: Sam Alba Date: Wed, 24 Mar 2021 09:30:57 -0700 Subject: [PATCH] stdlib: helm: fixed typo + moved helm install to own exec to optimize caching Signed-off-by: Sam Alba --- stdlib/kubernetes/helm/code.cue | 6 ------ stdlib/kubernetes/helm/helm.cue | 21 +++++++++++++++++++-- 2 files changed, 19 insertions(+), 8 deletions(-) diff --git a/stdlib/kubernetes/helm/code.cue b/stdlib/kubernetes/helm/code.cue index e22649ba..98da3765 100644 --- a/stdlib/kubernetes/helm/code.cue +++ b/stdlib/kubernetes/helm/code.cue @@ -1,12 +1,6 @@ package helm #code: #""" - # Install Helm - curl -sfL -S https://get.helm.sh/helm-v${HELM_VERSION}-linux-amd64.tar.gz | \ - tar -zx -C /tmp && \ - mv /tmp/linux-amd64/helm /usr/local/bin && \ - chmod +x /usr/local/bin/helm - # Add the repository helm repo add repository "${HELM_REPO}" helm repo update diff --git a/stdlib/kubernetes/helm/helm.cue b/stdlib/kubernetes/helm/helm.cue index dc3b7bab..54e0805e 100644 --- a/stdlib/kubernetes/helm/helm.cue +++ b/stdlib/kubernetes/helm/helm.cue @@ -56,6 +56,24 @@ import ( version: kubectlVersion } }, + llb.#Exec & { + env: HELM_VERSION: version + args: [ + "/bin/bash", + "--noprofile", + "--norc", + "-eo", + "pipefail", + "-c", + #""" + # Install Yarn + curl -sfL -S https://get.helm.sh/helm-v${HELM_VERSION}-linux-amd64.tar.gz | \ + tar -zx -C /tmp && \ + mv /tmp/linux-amd64/helm /usr/local/bin && \ + chmod +x /usr/local/bin/helm + """#, + ] + }, llb.#Mkdir & { path: "/helm" }, @@ -88,7 +106,6 @@ import ( KUBECONFIG: "/kubeconfig" KUBE_NAMESPACE: namespace - HELM_VERSION: version HELM_REPO: repository HELM_NAME: name HELM_ACTION: action @@ -98,7 +115,7 @@ import ( } mount: { if (values & string) != _|_ { - "/helm/varlues.yaml": values + "/helm/values.yaml": values } if (chart & dagger.#Artifact) != _|_ { "/helm/chart": from: chart