Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: promote-verify changes #1267

Merged
merged 1 commit into from
Nov 1, 2023
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 scripts/verify-promote
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ function banner() {
printf "\n%s\n%s\n%s\n" "$CHAR" "$1" "$CHAR"
}

export SF_HIDE_RELEASE_NOTES=true

# Versions for the old and new channels should match after promotion
banner "Verifying promote of npm dist tags: $OLD_CHANNEL -> $NEW_CHANNEL"
TAGS=$(npm view @salesforce/cli --json | jq -cr '."dist-tags"')
Expand Down Expand Up @@ -53,9 +55,9 @@ if [ "$NEW_VERSION" != "$OLD_MANIFEST_VERSION" ]; then
exit 1
fi

VERSIONS_URL="https://developer.salesforce.com/media/salesforce-cli/sf/versions/sf-linux-x64-tar-xz.json"
# Uncomment for testing on a M1 Mac
# VERSIONS_URL="https://developer.salesforce.com/media/salesforce-cli/sf/versions/sf-darwin-arm64-tar-xz.json"
VERSIONS_URL="https://developer.salesforce.com/media/salesforce-cli/sf/versions/sf-linux-x64-tar-xz.json"
VERSION_CONTENT=$(curl -s "$VERSIONS_URL" | jq -cr)


Expand Down Expand Up @@ -104,11 +106,17 @@ banner "Verify tarball install and that 'sf update $NEW_CHANNEL' version matches
# If you are testing this locally, you'll need to use a tarball built for your OS
# There is a VERSIONS_URL for M1 macs above that you can uncomment
# Other URLs can be found here: https://developer.salesforce.com/docs/atlas.en-us.sfdx_setup.meta/sfdx_setup/sfdx_setup_install_cli.htm#sfdx_setup_install_cli_olderversions
OLDER_VERSION_URL=$(echo "$VERSION_CONTENT" | jq 'to_entries[7]' | jq -r '.value')
OLDER_VERSION_URL=$(echo "$VERSION_CONTENT" | jq 'to_entries[15]' | jq -r '.value')
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change is to grab a version older than stable. With nightly builds we were grabbing a newer version at index 7

echo "Downloading old cli version from: $OLDER_VERSION_URL"

if [[ -d "$HOME/sf" ]]; then
echo "!! $HOME/sf directory already exists. Delete it and try again." && exit 1
# If the CI env var is set, delete the directory and continue
if [[ -n "$CI" ]]; then
echo "!! $HOME/sf directory already exists. Deleting it and continuing."
rm -rf "$HOME/sf"
else
echo "!! $HOME/sf directory already exists. Delete it and try again." && echo 1
fi
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was preventing any of the retry logic from making it past this step. Now we cleanup that dir in CI

fi

curl -s "$OLDER_VERSION_URL" --output sf-tarball.tar.xz && mkdir "$HOME/sf" && tar xJf sf-tarball.tar.xz -C "$HOME/sf" --strip-components 1 && rm -f sf-tarball.tar.xz
Expand Down
Loading