From 724fb79fe7d9a4243c41d9c1a15d53f5a7d36b9a Mon Sep 17 00:00:00 2001 From: Michel Weststrate Date: Wed, 11 Mar 2020 04:48:35 -0700 Subject: [PATCH] Don't submit release automatically when running on SC Summary: Our SC release job failed when submitting directly from the prepare-release script, as the jf context wasn't properly setup. So instead we reuse the code we already have for that in SandcastleFlipperAutoReleaseCommand. However, for manual releases we still do submit automatically and in name of the current user. Reviewed By: passy Differential Revision: D20384247 fbshipit-source-id: ed5eca180f009611f2890f8cb665bf203789d189 --- scripts/prepare-release.sh | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/scripts/prepare-release.sh b/scripts/prepare-release.sh index 0c3cc253b..f7d6c5a07 100755 --- a/scripts/prepare-release.sh +++ b/scripts/prepare-release.sh @@ -38,7 +38,8 @@ fi echo "✨ Making a new release..." -REVISION="$1" +# When starting this job from SandcastleFlipperAutoReleaseCommand, we pass in the revision to release +SANDCASTLE_REVISION="$1" DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" SONAR_DIR="$DIR/../" FLIPPERKIT_PODSPEC_PATH="$SONAR_DIR/FlipperKit.podspec" @@ -51,7 +52,7 @@ OLD_VERSION_POD_ARG=$(< "$FLIPPER_PODSPEC_PATH" grep "$FLIPPERKIT_VERSION_TAG =" OLD_VERSION="${OLD_VERSION_POD_ARG##* }" # if we got called with a rev argument, we got triggered from our automatic sandcastle job -if [ "$REVISION" != "" ]; +if [ "$SANDCASTLE_REVISION" != "" ]; then # In future, bump majors instead of minors? echo "Automatically bumping version to next minor in package.json" @@ -128,6 +129,13 @@ Reviewers: flipper\n\n\ Tags: accept2ship" )" -# Submit diffs -echo "Submitting diffs for review..." -jf submit -n -r.^::. +if [ "$SANDCASTLE_REVISION" == "" ]; +then + # Submit diffs, we only do this when running locally. + # From SandcastleFlipperAutoReleaseCommand, the diffs are submitted + # later by using the bot context + echo "Submitting diffs for review..." + jf submit -n -r.^::. +else + echo "Skip submitting diffs, as this diffs should be submitted by SC" +fi