feat: improved helm chart and repo support
This commit is contained in:
@@ -4,4 +4,4 @@ RUN mkdir -p /home/argocd/cmp-server/config/
|
||||
COPY plugin.yaml /home/argocd/cmp-server/config/
|
||||
|
||||
WORKDIR /plugin
|
||||
COPY init.sh get-values.sh generate.sh ./
|
||||
COPY init-helm-repos.sh init.sh get-values.sh generate.sh ./
|
||||
|
||||
@@ -1,25 +1,24 @@
|
||||
#!/bin/sh
|
||||
|
||||
export HOME=/tmp
|
||||
export HOME=/helm-working-dir
|
||||
|
||||
env > /tmp/$ARGOCD_APP_NAME.env
|
||||
|
||||
echo "$ARGOCD_APP_PARAMETERS" | jq '.[] | select(.name == "helm-parameters") | .map' | yq -P -oy > parameters.yaml
|
||||
cp parameters.yaml /tmp/$ARGOCD_APP_NAME-parameters.yaml
|
||||
|
||||
if [ -d chart ]; then
|
||||
CHART=chart
|
||||
elif [ -f chart -o "$PARAM_CHART" = "." ]; then
|
||||
CHART=$(cat chart)
|
||||
helm show values $CHART > values-base.yaml
|
||||
elif [ -n "$PARAM_CHART" ]; then
|
||||
if [ -n "$PARAM_CHART" -a "$PARAM_CHART" != "." ]; then
|
||||
CHART=$PARAM_CHART
|
||||
elif [ -d chart ]; then
|
||||
CHART=chart
|
||||
elif [ -f chart ]; then
|
||||
CHART=$(cat chart)
|
||||
else
|
||||
CHART="."
|
||||
fi
|
||||
|
||||
[ -f chart/values.yaml ] && VALUES="-f chart/values.yaml"
|
||||
[ -f values-base.yaml ] && VALUES="$VALUES -f values-base.yaml"
|
||||
[ -f values-chart.yaml ] && VALUES="$VALUES -f values-chart.yaml"
|
||||
[ -f values.yaml ] && VALUES="$VALUES -f values.yaml"
|
||||
[ -f values-$PARAM_ENV.yaml ] && VALUES="$VALUES -f values-$PARAM_ENV.yaml"
|
||||
VALUES="$VALUES -f parameters.yaml"
|
||||
|
||||
@@ -2,6 +2,8 @@
|
||||
|
||||
if [ -f values.yaml ]; then
|
||||
VALUES="values.yaml"
|
||||
elif [ -f values-chart.yaml ]; then
|
||||
VALUES="values-chart.yaml"
|
||||
elif [ -f chart/values.yaml ]; then
|
||||
VALUES="chart/values.yaml"
|
||||
else
|
||||
|
||||
@@ -0,0 +1,16 @@
|
||||
#!/bin/sh
|
||||
|
||||
export HOME=/helm-working-dir
|
||||
|
||||
helm repo add --username argocd-helm --password "$OCEANBOX_HELM_ACCESS_TOKEN" oceanbox \
|
||||
https://gitlab.com/api/v4/projects/54396343/packages/helm/stable
|
||||
|
||||
helm repo add bitnami https://charts.bitnami.com/bitnami
|
||||
helm repo add cerbos https://download.cerbos.dev/helm-charts
|
||||
helm repo add dapr https://dapr.github.io/helm-charts/
|
||||
helm repo add ncsa https://opensource.ncsa.illinois.edu/charts
|
||||
helm repo add dex https://charts.dexidp.io
|
||||
|
||||
helm repo update
|
||||
|
||||
|
||||
@@ -1,14 +1,10 @@
|
||||
#!/bin/sh
|
||||
|
||||
export HOME=/tmp
|
||||
|
||||
helm repo add oceanbox --password $OCEANBOX_HELM_ACCESS_TOKEN oceanbox https://gitlab.com/api/v4/projects/54396343/packages/helm/stabl
|
||||
|
||||
helm repo add bitnami https://charts.bitnami.com/bitnami
|
||||
helm repo add cerbos https://download.cerbos.dev/helm-charts
|
||||
helm repo add dapr https://dapr.github.io/helm-charts/
|
||||
helm repo add ncsa https://opensource.ncsa.illinois.edu/charts
|
||||
helm repo add dex https://charts.dexidp.io
|
||||
|
||||
helm repo update
|
||||
export HOME=/helm-working-dir
|
||||
|
||||
if [ -n "$PARAM_CHART" -a "$PARAM_CHART" != "." ]; then
|
||||
helm show values $PARAM_CHART > values-chart.yaml
|
||||
elif [ -f chart ]; then
|
||||
CHART=$(cat chart)
|
||||
helm show values $CHART > values-chart.yaml
|
||||
fi
|
||||
|
||||
Reference in New Issue
Block a user