Skip to content

Commit

Permalink
NO-JIRA Fix missing package generation on non-LTA branches
Browse files Browse the repository at this point in the history
  • Loading branch information
carminevassallo authored Dec 18, 2024
1 parent 09d3236 commit 5675a13
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions .cirrus/package.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,18 +10,14 @@ set -xeuo pipefail

PREVIOUS_RELEASE=$(gh api "/repos/{owner}/{repo}/releases" --jq "[.[] | select(.target_commitish==\"${TARGET_BRANCH}\")][1].tag_name")

# There MIGHT be a some edge case where PREVIOUS_RELEASE shouldn't be HEAD,
# for example, releasing a patch for non-LTA. To be investigated.
[[ -z "${PREVIOUS_RELEASE}" ]] && PREVIOUS_RELEASE="HEAD" || echo "${PREVIOUS_RELEASE}"

CHARTS=$(ct list-changed --since "${PREVIOUS_RELEASE}" --target-branch "${TARGET_BRANCH}")
[[ -z "${PREVIOUS_RELEASE}" ]] && CHARTS=("charts/sonarqube-dce" "charts/sonarqube") || CHARTS=$(ct list-changed --since "${PREVIOUS_RELEASE}" --target-branch "${TARGET_BRANCH}")

BUILD_METADATA="-${BUILD_NUMBER}"
[[ ${CIRRUS_RELEASE:-} != "" ]] && BUILD_METADATA=""

echo "${CHARTS}"
echo "${CHARTS[@]}"

for chart in ${CHARTS}; do
for chart in ${CHARTS[@]}; do
_original_version=$(yq '.version' "${chart}"/Chart.yaml)
_new_version="${_original_version}${BUILD_METADATA}"
helm dependency build "${chart}"
Expand Down

0 comments on commit 5675a13

Please sign in to comment.