Skip to content

Commit

Permalink
SONAR-23561 Remove the Artifact Build Number from Helm releases
Browse files Browse the repository at this point in the history
  • Loading branch information
carminevassallo authored Nov 12, 2024
1 parent 5e77c91 commit 059b47a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions .cirrus/package.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,6 @@ set -xeuo pipefail
: "${BUILD_NUMBER:?}"
: "${CIRRUS_BASE_BRANCH:=}"

VERSION_SEPERATOR="-"
[[ ${CIRRUS_RELEASE:-} != "" ]] && VERSION_SEPERATOR="+"

[[ -n "${CIRRUS_BASE_BRANCH}" ]] && TARGET_BRANCH="${CIRRUS_BASE_BRANCH}" || TARGET_BRANCH="${CIRRUS_BRANCH}"

PREVIOUS_RELEASE=$(gh api "/repos/{owner}/{repo}/releases" --jq "[.[] | select(.target_commitish==\"${TARGET_BRANCH}\")][1].tag_name")
Expand All @@ -19,11 +16,14 @@ PREVIOUS_RELEASE=$(gh api "/repos/{owner}/{repo}/releases" --jq "[.[] | select(.

CHARTS=$(ct list-changed --since "${PREVIOUS_RELEASE}" --target-branch "${TARGET_BRANCH}")

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

echo "${CHARTS}"

for chart in ${CHARTS}; do
_original_version=$(yq '.version' "${chart}"/Chart.yaml)
_new_version="${_original_version}${VERSION_SEPERATOR}${BUILD_NUMBER}"
_new_version="${_original_version}${BUILD_METADATA}"
helm dependency build "${chart}"
helm package --version "${_new_version}" "${chart}"
done
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -67,4 +67,4 @@ jobs:
SLACK_WEBHOOK: ${{ fromJSON(steps.secrets.outputs.vault).slack_webhook_url }}
SLACK_CHANNEL: team-sonarqube-build
with:
args: "Helm Chart Release failed, see the logs at https://github.com/SonarSource/helm-chart-sonarqube/actions"
args: "Helm Chart Release failed, see the logs at https://github.com/SonarSource/helm-chart-sonarqube/actions"

0 comments on commit 059b47a

Please sign in to comment.