Update createHelmYaml.sh
Some checks failed
Build docker container / Build image (push) Has been cancelled
Some checks failed
Build docker container / Build image (push) Has been cancelled
This commit is contained in:
parent
a8631e145d
commit
42e73e0b58
@ -1,7 +1,9 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
|
# Function to create HelmChart YAML
|
||||||
|
createHelmYaml() {
|
||||||
# Load values from Chart.yaml
|
# Load values from Chart.yaml
|
||||||
chart_version=$(yq e '.dependencies[0].version' Chart.yaml)
|
chart_version=$(yq e '.version' Chart.yaml)
|
||||||
chart_name=$(yq e '.name' Chart.yaml)
|
chart_name=$(yq e '.name' Chart.yaml)
|
||||||
chart_repo=$(yq e '.dependencies[0].repository' Chart.yaml)
|
chart_repo=$(yq e '.dependencies[0].repository' Chart.yaml)
|
||||||
chart_namespace=$(yq e '.annotations.namespace' Chart.yaml)
|
chart_namespace=$(yq e '.annotations.namespace' Chart.yaml)
|
||||||
@ -35,7 +37,17 @@ helm_chart_yaml=$(yq eval -n ".apiVersion = \"helm.cattle.io/v1\" |
|
|||||||
# If repo is set, add it to the spec
|
# If repo is set, add it to the spec
|
||||||
if [[ -n "$repo" ]]; then
|
if [[ -n "$repo" ]]; then
|
||||||
helm_chart_yaml=$(echo "$helm_chart_yaml" | yq eval ".spec.repo = \"$repo\"")
|
helm_chart_yaml=$(echo "$helm_chart_yaml" | yq eval ".spec.repo = \"$repo\"")
|
||||||
|
elif
|
||||||
|
kubectl version
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Print the final YAML to stdout
|
# Print the final YAML to stdout
|
||||||
echo "$helm_chart_yaml"
|
echo "$helm_chart_yaml"
|
||||||
|
}
|
||||||
|
|
||||||
|
# Check if the action environment variable is set to 'print'
|
||||||
|
if [[ "$action" == "print" ]]; then
|
||||||
|
createHelmYaml
|
||||||
|
else:
|
||||||
|
kubectl version --client=true
|
||||||
|
fi
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user