Skip to content
This repository has been archived by the owner on Feb 15, 2022. It is now read-only.

Change build.sh script to point to Helm 2 compatible version of Fabrikate #1451

Merged
merged 3 commits into from
Nov 2, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 11 additions & 3 deletions gitops/azure-devops/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,21 @@ function helm_init() {
}

# Obtain version for Fabrikate
# If the version number is not provided, then download the latest
# If the version number is not provided, then download the latest Helm2 compatible version
# The Major version number can be provided as the first argument,
function get_fab_version() {
# shellcheck disable=SC2153
if [ -z "$VERSION" ]
then
# By default, the script will use the most recent non-prerelease, non-draft release Fabrikate
VERSION_TO_DOWNLOAD=$(curl -s "https://api.github.com/repos/microsoft/fabrikate/releases/latest" | grep "tag_name" | sed -E 's/.*"([^"]+)".*/\1/')
# By default, the script will use the Helm 2 compatible, non-prerelease, non-draft release Fabrikate.
MAJOR=${1:-0}
VERSIONS=$(curl -s "https://api.github.com/repos/microsoft/fabrikate/git/matching-refs/tags/$MAJOR" | grep "/refs/tags/$MAJOR" | while read -r line ; do
VERSION=${line##*/}
VERSION=${VERSION%\",}
echo "$VERSION"
done | sort -V)
VERSION_TO_DOWNLOAD=${VERSIONS##*$'\n'}
echo $VERSION_TO_DOWNLOAD
else
echo "Fabrikate Version: $VERSION"
VERSION_TO_DOWNLOAD=$VERSION
Expand Down