-
Notifications
You must be signed in to change notification settings - Fork 113
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
Update scripts Add browser_downloader.sh independent of runtime env for cypress tests Add more Add more Add more Add download_chromium to integtest.sh for standalone chromium installation Add more Signed-off-by: Peter Zhu <[email protected]> (cherry picked from commit 463125a) Co-authored-by: Peter Zhu <[email protected]>
- Loading branch information
1 parent
f92d151
commit 7fbb1da
Showing
2 changed files
with
60 additions
and
1 deletion.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
#!/bin/bash | ||
|
||
set -e | ||
|
||
BROWSER_DIR=`dirname $(realpath $0)` && cd $BROWSER_DIR | ||
|
||
function download_chromium { | ||
|
||
# Set defaults | ||
arch="x64" | ||
os="linux" | ||
chromium_version="112" | ||
chromium_binary="chrome" | ||
ARCHTYPE=`uname -m` | ||
force=$1 | ||
|
||
# Architecture | ||
if [ "$ARCHTYPE" = "aarch64" ] || [ "$ARCHTYPE" = "arm64" ]; then | ||
arch="arm64" | ||
fi | ||
|
||
# Platform | ||
if (echo "$OSTYPE" | grep -qi darwin); then | ||
os="mac" | ||
chromium_binary="Chromium.app/Contents/MacOS/Chromium" | ||
elif [ "$OSTYPE" = "msys" ] || [ "$OSTYPE" = "cygwin" ] || [ "$OSTYPE" = "win32" ]; then | ||
os="win" | ||
chromium_binary="chrome.exe" | ||
BROWSER_DIR=`pwd -W` | ||
fi | ||
|
||
# Variables | ||
artifact="chromium-$os-$arch.zip" | ||
chromium_url="https://ci.opensearch.org/ci/dbc/tools/chromium/$chromium_version/zip/$artifact" | ||
chromium_path="$BROWSER_DIR/chromium/chrome-$os/$chromium_binary" | ||
|
||
# Get artifact | ||
if [ "$force" = "true" ] || [ ! -f "$chromium_path" ]; then | ||
rm -rf chromium | ||
mkdir -p chromium | ||
cd chromium | ||
curl -sSLO $chromium_url | ||
unzip -qq $artifact | ||
rm $artifact | ||
fi | ||
|
||
echo "$chromium_path chromium-$chromium_version os-$os arch-$arch" | ||
|
||
# Verify binary | ||
if [ "$os" = "win" ]; then | ||
powershell -command "(Get-Item $chromium_path)".VersionInfo | ||
else | ||
$chromium_path --version | ||
fi | ||
} |
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