From 518575885548b043cadfac219074a62b91327e13 Mon Sep 17 00:00:00 2001 From: Darin Kelkhoff Date: Thu, 25 May 2023 10:55:10 -0500 Subject: [PATCH] add check for "snapshot-BRANCH_SLUG" arg to update-all-qqq-deps.sh -- if given, then we look for branchy versions, else we use main versions [skip ci] --- qqq-dev-tools/bin/get-latest-snapshot.sh | 6 ++++-- qqq-dev-tools/bin/update-all-qqq-deps.sh | 7 ++++++- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/qqq-dev-tools/bin/get-latest-snapshot.sh b/qqq-dev-tools/bin/get-latest-snapshot.sh index 232842d5..b36e5ae4 100755 --- a/qqq-dev-tools/bin/get-latest-snapshot.sh +++ b/qqq-dev-tools/bin/get-latest-snapshot.sh @@ -97,7 +97,7 @@ else artifact=$1 version=$2 - if [ "$version" == "-l" ]; then + if [ "$version" == "-s" ]; then useSlug=$(checkForBranchBuild $artifact) if [ "$useSlug" == "1" ]; then version=$SLUG @@ -105,9 +105,11 @@ else version=$CURRENT_VERSION fi echo "Using $version for $artifact" >&2 + elif [ "$version" == "-l" ]; then + version=$CURRENT_VERSION fi - if [ -z "$ar^tifact" -o -z "$version" ]; then + if [ -z "$artifact" -o -z "$version" ]; then echo "Usage: $0 artifact snapshot-version-prefix" echo " or: $0 artifact -l (latest of CURRENT_VERSION, or branch-slug, if it has been deployed)" echo " or: $0 -i (interactive mode)" diff --git a/qqq-dev-tools/bin/update-all-qqq-deps.sh b/qqq-dev-tools/bin/update-all-qqq-deps.sh index 846eefeb..517e5a69 100755 --- a/qqq-dev-tools/bin/update-all-qqq-deps.sh +++ b/qqq-dev-tools/bin/update-all-qqq-deps.sh @@ -13,9 +13,14 @@ fi CURRENT_VERSION="$(cat $QQQ_DEV_TOOLS_DIR/CURRENT-SNAPSHOT-VERSION)" MODULE_LIST_FILE=$QQQ_DEV_TOOLS_DIR/MODULE_LIST +getLatestSnapshotArg="-l" +if [[ "$1" == "snapshot-BRANCH_SLUG" ]]; then + getLatestSnapshotArg="-s" +fi + for module in $(cat $MODULE_LIST_FILE); do echo "Updating $module..." - version=$(get-latest-snapshot.sh $module -l) + version=$(get-latest-snapshot.sh $module $getLatestSnapshotArg) update-dep.sh $module $version -q done