-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
61 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -26,6 +26,14 @@ jobs: | |
env: | ||
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}" | ||
|
||
- name: Install pybump | ||
run: | | ||
python3 -m pip install --upgrade pip | ||
pip install pybump | ||
- name: Bump Chart Versions | ||
run: scripts/bump-charts.sh | ||
|
||
- name: Run chart-releaser | ||
uses: helm/[email protected] | ||
env: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
#!/bin/bash | ||
|
||
ONPREM_CHART_FILE="charts/tracetest-onprem/Chart.yaml" | ||
ONPREM_CHART_NAME="tracetest-onprem" | ||
|
||
changed_charts=$(git --no-pager diff --name-only HEAD~1 charts | grep '/' | cut -d'/' -f1-2 | uniq) | ||
|
||
# If no changed charts, exit with a message | ||
if [[ -z "$changed_charts" ]]; then | ||
echo "No charts have been changed." | ||
exit 0 | ||
fi | ||
|
||
# Loop through the unique charts and run pybump on each Chart.yaml | ||
for chart in $changed_charts; do | ||
chartName=$(basename "$chart") | ||
if [[ "$chartName" == "$ONPREM_CHART_NAME" ]]; then | ||
continue | ||
fi | ||
|
||
echo "Running pybump on $chart/Chart.yaml" | ||
newChartVersion=$(pybump bump --file "$chart/Chart.yaml" --level minor) | ||
|
||
if [[ $? -ne 0 ]]; then | ||
echo "Error occurred while running pybump on $chart/Chart.yaml" | ||
exit 1 | ||
fi | ||
|
||
echo "Update $chartName to $newChartVersion in $ONPREM_CHART_FILE" | ||
yq eval '.dependencies[] |= (select(.name == "'"$chartName"'").version = "'"$newChartVersion"'")' "$ONPREM_CHART_FILE" -i | ||
|
||
if [[ $? -ne 0 ]]; then | ||
echo "Error occurred while updating $chartName in $ONPREM_CHART_FILE" | ||
exit 1 | ||
fi | ||
|
||
git add "$chart/Chart.yaml" | ||
done | ||
|
||
echo "Bumping version of $ONPREM_CHART_FILE" | ||
newVersion=$(pybump bump --file "$ONPREM_CHART_FILE" --level minor) | ||
if [[ $? -ne 0 ]]; then | ||
echo "Error occurred while bumping the minor version of $ONPREM_CHART_FILE" | ||
exit 1 | ||
fi | ||
echo "Updated version: $newVersion" | ||
|
||
git add $ONPREM_CHART_FILE | ||
|
||
git status | ||
git commit -m "Update tracetest-onprem version to $newVersion" | ||
git push --force-with-lease |