Skip to content

Commit

Permalink
cdpd-patcher: fallback to base_version if it's different
Browse files Browse the repository at this point in the history
  • Loading branch information
abstractdog authored and kgyrtkirk committed Jun 10, 2021
1 parent fdb2207 commit e7a6f95
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/main/scripts/cdpd-patcher
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ case "$VERSION" in
echo "@@@ lookup stackversion for releasline $VERSION"
wget -nv -O $tmp "http://release.infra.cloudera.com/hwre-api/getreleaseversion?stack=CDH&releaseline=$VERSION"
VERSION="`cat $tmp|jq -r .version`"
BASE_VERSION="`cat $tmp|jq -r '."base-version"'`"
;;
FENG)
VERSION=7.0.2.1
Expand All @@ -41,7 +42,16 @@ case "$VERSION" in
esac

VERSION="${VERSION//CDH-/}"
BASE_VERSION="${BASE_VERSION%%-*}" # e.g. 7.2.11.0-123 ==> 7.2.11.0

echo "@@@ version: $VERSION"
echo "@@@ base_version: $BASE_VERSION"

# if versions are different and BASE_VERSION is not empty (wasn't null in JSON)
if [ ! "$VERSION" = "$BASE_VERSION" -a -n "$BASE_VERSION" ]; then
echo "VERSION and BASE_VERSION are not equal, falling back to BASE_VERSION: $BASE_VERSION"
VERSION=$BASE_VERSION
fi

wget -nv -O $tmp "http://release.infra.cloudera.com/hwre-api/latestcompiledbuild?stack=CDH&release=${VERSION}&os=centos7"
build="`cat $tmp|jq -r .build`"
Expand Down

0 comments on commit e7a6f95

Please sign in to comment.