Skip to content

Commit

Permalink
Update Helm Charts if present
Browse files Browse the repository at this point in the history
  • Loading branch information
gildas committed Aug 2, 2021
1 parent 233e153 commit 8cfce3a
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 0 deletions.
10 changes: 10 additions & 0 deletions hooks/filter-flow-hotfix-start-version
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,16 @@ if [[ ! $VERSION =~ [0-9]+\.[0-9]+\.[0-9]+ ]]; then
VERSION=$(bump_version $VERSION $LEVEL)
fi

echo "Checking for Chart"
if [[ -f $ROOT_DIR/chart/Chart.yaml ]]; then
echo "Found Chart"
CHART_VERSION=$(grep "^version:" $ROOT_DIR/chart/Chart.yaml | sed -E "s/^version:\s+([0-9]+\.[0-9]+\.[0-9]+)/\1/")
echo "Current Chart Version: $CHART_VERSION"
CHART_VERSION=$(bump_version $CHART_VERSION $LEVEL)
echo "New Chart Version: $CHART_VERSION"
sed -Ei "/^version:/s/[0-9]+\.[0-9]+\.[0-9]/${CHART_VERSION}/" "$ROOT_DIR/chart/Chart.yaml"
fi

# Return the VERSION
echo "${VERSION}"
exit 0
8 changes: 8 additions & 0 deletions hooks/filter-flow-release-start-version
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,14 @@ if [[ ! $VERSION =~ [0-9]+\.[0-9]+\.[0-9]+ ]]; then
VERSION=$(bump_version $VERSION $LEVEL)
fi

if [[ -f $ROOT_DIR/chart/Chart.yaml ]]; then
CHART_VERSION=$(grep "^version:" $ROOT_DIR/chart/Chart.yaml | sed -E "s/^version:\s+([0-9]+\.[0-9]+\.[0-9]+)/\1/")
CHART_VERSION=$(bump_version $CHART_VERSION $LEVEL)
sed -Ei "/^version:/s/[0-9]+\.[0-9]+\.[0-9]/${CHART_VERSION}/" "$ROOT_DIR/chart/Chart.yaml"
sed -Ei "/^appVersion:/s/[0-9]+\.[0-9]+\.[0-9]/${VERSION}/" "$ROOT_DIR/chart/Chart.yaml"
git stash push --quiet
fi

# Return the VERSION
echo "${VERSION}"
exit 0
5 changes: 5 additions & 0 deletions hooks/post-flow-hotfix-start
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,11 @@ VERSION_TAG=$(get_config gitflow.prefix.versiontag)
update_version_file "$VERSION_FILE" $VERSION
die_on_error "Failed to update $VERSION_FILE with version $VERSION"

if [[ -f $ROOT_DIR/chart/Chart.yaml ]]; then
git stash pop --quiet
git add "$ROOT_DIR/chart/Chart.yaml"
fi

git add "$VERSION_FILE"
die_on_error "Failed to stage $VERSION_FILE"
git commit -m "Bumped to version $VERSION"
Expand Down
5 changes: 5 additions & 0 deletions hooks/post-flow-release-start
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,11 @@ VERSION_TAG=$(get_config gitflow.prefix.versiontag)
update_version_file "$VERSION_FILE" $VERSION
die_on_error "Failed to update $VERSION_FILE with version $VERSION"

if [[ -f $ROOT_DIR/chart/Chart.yaml ]]; then
git stash pop --quiet
git add "$ROOT_DIR/chart/Chart.yaml"
fi

git add "$VERSION_FILE"
die_on_error "Failed to stage $VERSION_FILE"
git commit -m "Bumped to version $VERSION"
Expand Down

0 comments on commit 8cfce3a

Please sign in to comment.