-
-
Notifications
You must be signed in to change notification settings - Fork 14.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Latest version on Linux is actually 4.9.2, but latest on Mac is 4.9.1, so only updating to 4.9.1 for consistency between the two. Also added passthru.updateScript to keep this package up to date in the future, with associated refactoring to make that possible. (cherry picked from commit d31e17f)
- Loading branch information
1 parent
c126db1
commit a89925b
Showing
2 changed files
with
47 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
#!/usr/bin/env nix-shell | ||
#!nix-shell -i bash -p common-updater-scripts curl jq | ||
# API documentation: https://docs.saucelabs.com/dev/api/connect/ | ||
|
||
set -Eeuo pipefail | ||
shopt -s lastpipe | ||
die() { | ||
echo -e "${BASH_SOURCE[0]}:${BASH_LINENO[0]}" ERROR: "$@" >&2 | ||
exit 1 | ||
} | ||
# shellcheck disable=2154 | ||
trap 's=$?; die "$BASH_COMMAND"; exit $s' ERR | ||
|
||
# Versions may not be updated simultaneously across all platforms, so need to figure out the latest | ||
# version that includes both platforms. For example, currently the latest on Linux is 4.9.2 while | ||
# Mac is 4.9.1. | ||
response=$(curl -fsSL 'https://api.us-west-1.saucelabs.com/rest/v1/public/tunnels/info/versions?all=true') | ||
all_versions=$(jq --exit-status --raw-output \ | ||
'.all_downloads | to_entries[] | select(.value | has("linux") and has("osx")) | .key' \ | ||
<<< "$response") | ||
latest_version=$(sort --version-sort <<< "$all_versions" | tail -n 1) | ||
for platform in x86_64-linux x86_64-darwin; do | ||
update-source-version sauce-connect 0 "sha256-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=" \ | ||
--source-key="passthru.sources.$platform" | ||
update-source-version sauce-connect "$latest_version" \ | ||
--source-key="passthru.sources.$platform" | ||
done |