Skip to content

Commit

Permalink
small refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
carminevassallo committed Nov 12, 2024
1 parent 545412f commit a036f0a
Showing 1 changed file with 10 additions and 15 deletions.
25 changes: 10 additions & 15 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,24 +57,19 @@ jobs:
version: v3.7.0
- name: Remove the build number from the charts' versions and re-package the helm charts
run: |
SQ_CHART="sonarqube"
SQ_DCE_CHART="sonarqube-dce"
remove_build_number() {
local chart="$1"
if [ -d "$chart" ]; then
sed -i '/^version:/ {s/\(^version: [0-9]*\.[0-9]*\.[0-9]*\)\+.*/\1/;}' "$chart/Chart.yaml"
helm package "$chart"
rm -rf "$chart"
fi
}
cd ${{ steps.local_repo.outputs.dir }}
# Remove the build number if SQ_CHART is present
if [ -d "$SQ_CHART" ]; then
sed -i '/^version:/ {s/\(^version: [0-9]*\.[0-9]*\.[0-9]*\)\+.*/\1/;}' $SQ_CHART/Chart.yaml
helm package $SQ_CHART
rm -rf $SQ_CHART
fi
# Remove the build number if SQ_DCE_CHART is present
if [ -d "$SQ_DCE_CHART" ]; then
sed -i '/^version:/ {s/\(^version: [0-9]*\.[0-9]*\.[0-9]*\)\+.*/\1/;}' $SQ_DCE_CHART/Chart.yaml
helm package $SQ_DCE_CHART
rm -rf $SQ_DCE_CHART
fi
remove_build_number "sonarqube"
remove_build_number "sonarqube-dce"
cd ..
- name: Check resulting files
Expand Down

0 comments on commit a036f0a

Please sign in to comment.