Attempted to make changes to automation to work properly/better (avoid false-positive of remote chart already existing)
Some checks failed
Deploy the Helm Chart / build (push) Failing after 8s
Some checks failed
Deploy the Helm Chart / build (push) Failing after 8s
This commit is contained in:
parent
0aa953b9e5
commit
216e0d0c1e
2 changed files with 16 additions and 6 deletions
|
|
@ -34,12 +34,22 @@ jobs:
|
|||
helm repo add BridgemanAccessible https://helm.bridgemanaccessible.ca
|
||||
|
||||
# Check if the chart is already in the repository or not
|
||||
REMOTE_CHART_WORK_OUTPUT=$(helm search repo BridgemanAccessible/$CHART_NAME 2>/dev/null || echo "")
|
||||
if [ -n "$REMOTE_CHART_WORK_OUTPUT" ]; then
|
||||
#REMOTE_CHART_WORK_OUTPUT=$(helm search repo BridgemanAccessible/$CHART_NAME 2>/dev/null || echo "")
|
||||
#if [ -n "$REMOTE_CHART_WORK_OUTPUT" ]; then
|
||||
|
||||
SEARCH_JSON=$(helm search repo BridgemanAccessible/$CHART_NAME --output json)
|
||||
|
||||
# Parse the JSON to see if our specific chart name exists in the results
|
||||
IS_FOUND=$(echo "$SEARCH_JSON" | jq -r ".[] | select(.name == \"BridgemanAccessible/$CHART_NAME\") | .name"
|
||||
|
||||
if [ -n "$IS_FOUND" ]; then
|
||||
# The chart is already in the repository, so we need to check if the version is the same or not
|
||||
echo "Chart already exists in the repository. Checking version..."
|
||||
|
||||
IFS=' ' read -r -a REMOTE_VERSIONS <<< $(helm search repo BridgemanAccessible/$CHART_NAME --output json | jq '.[].version | @sh')
|
||||
# Parse the versions
|
||||
#IFS=' ' read -r -a REMOTE_VERSIONS <<< $(helm search repo BridgemanAccessible/$CHART_NAME --output json | jq '.[].version | @sh')
|
||||
# From the ALREADY fetched JSON
|
||||
IFS=' ' read -r -a REMOTE_VERSIONS <<< $(echo "$SEARCH_JSON" | jq -r ".[] | select(.name == \"BridgemanAccessible/$CHART_NAME\") | .version")
|
||||
|
||||
echo "Remote Chart Versions: ${REMOTE_VERSIONS[@]}"
|
||||
else
|
||||
|
|
|
|||
|
|
@ -8,4 +8,4 @@ maintainers:
|
|||
name: ba-custom-hashicorp-vault
|
||||
sources:
|
||||
- https://git.bridgemanaccessible.ca/Bridgeman-Accessible/custom-hashicorp-vault
|
||||
version: "1.0.1"
|
||||
version: "1.0.0"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue