Skip to content

Commit

Permalink
chore: get latest released chart by app version
Browse files Browse the repository at this point in the history
Signed-off-by: Ahmed AbouZaid <6760103+aabouzaid@users.noreply.github.com>
  • Loading branch information
aabouzaid committed Jun 10, 2024
1 parent 90b1417 commit ff2d908
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion .github/actions/workflow-vars/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -82,11 +82,24 @@ runs:
# The var is needed in some non-shell steps.
echo "ingress-host=${TEST_INGRESS_HOST}" | tee -a $GITHUB_OUTPUT
- name: Set workflow vars - Chart version
shell: bash
run: |
# Chart version.
# Used to install previous supported versions of Camunda Helm charts.
# This is only needed in the upgrade flow not the setup.
get_latest_released_chart_by_app_version() {
app_version="${1}"
helm repo add camunda https://helm.camunda.io > /dev/null
helm search repo camunda/camunda-platform --versions --output json |
jq -r --arg app_version "$app_version" \
'[.[] | select (.app_version == $app_version)] | first | .version'
}
if [[ "${{ inputs.setup-flow }}" == 'upgrade' ]]; then
TEST_CHART_VERSION="$(yq '.version' charts/${{ inputs.chart-dir }}/Chart.yaml)"
app_version="$(yq '.appVersion' charts/${{ inputs.chart-dir }}/Chart.yaml)"
TEST_CHART_VERSION="$(get_latest_released_chart_by_app_version ${app_version})"
echo "TEST_CHART_VERSION=${TEST_CHART_VERSION}" | tee -a $GITHUB_ENV
fi
Expand Down

0 comments on commit ff2d908

Please sign in to comment.