[ubuntu] replace wget to download_with_retries helper (#3087)

This commit is contained in:
Aleksandr Chebotov
2021-04-02 18:47:50 +03:00
committed by GitHub
parent 0917a07677
commit be27ebfdb3
11 changed files with 32 additions and 18 deletions

View File

@@ -4,9 +4,12 @@
## Desc: Installs Alibaba Cloud CLI
################################################################################
# Source the helpers for use with the script
source $HELPER_SCRIPTS/install.sh
# Install Alibaba Cloud CLI
URL=$(curl -s https://api.github.com/repos/aliyun/aliyun-cli/releases/latest | jq -r '.assets[].browser_download_url | select(contains("aliyun-cli-linux"))')
wget -P /tmp $URL
download_with_retries $URL "/tmp"
tar xzf /tmp/aliyun-cli-linux-*-amd64.tgz
mv aliyun /usr/local/bin

View File

@@ -51,7 +51,7 @@ mkdir -p ${ANDROID_SDK_ROOT}
# Download the latest command line tools so that we can accept all of the licenses.
# See https://developer.android.com/studio/#command-tools
wget -O android-sdk.zip https://dl.google.com/android/repository/sdk-tools-linux-4333796.zip
download_with_retries https://dl.google.com/android/repository/sdk-tools-linux-4333796.zip "." android-sdk.zip
unzip -qq android-sdk.zip -d ${ANDROID_SDK_ROOT}
rm -f android-sdk.zip

View File

@@ -5,10 +5,13 @@
## Requires Python >=3.6, must be run as non-root user after toolset installation
################################################################################
# Source the helpers for use with the script
source $HELPER_SCRIPTS/install.sh
# Download latest aws sam cli sources
TarballUrl=$(curl -s https://api.github.com/repos/aws/aws-sam-cli/releases/latest | jq -r '.tarball_url')
TarballPath="/tmp/aws-sam-cli.tar.gz"
wget $TarballUrl -O $TarballPath
download_with_retries $TarballUrl "/tmp" "aws-sam-cli.tar.gz"
tar -xzf $TarballPath -C /tmp
cd /tmp/aws-aws-sam-cli*

View File

@@ -30,7 +30,7 @@ function SetDefaultClang {
}
# Download script for automatic installation
wget https://apt.llvm.org/llvm.sh
download_with_retries https://apt.llvm.org/llvm.sh
chmod +x llvm.sh
versions=$(get_toolset_value '.clang.versions[]')

View File

@@ -8,7 +8,7 @@
install_packages=(podman buildah skopeo)
source /etc/os-release
sh -c "echo 'deb https://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/stable/x${NAME}_${VERSION_ID}/ /' > /etc/apt/sources.list.d/devel:kubic:libcontainers:stable.list"
wget -nv https://download.opensuse.org/repositories/devel:kubic:libcontainers:stable/x${NAME}_${VERSION_ID}/Release.key -O Release.key
wget -qnv https://download.opensuse.org/repositories/devel:kubic:libcontainers:stable/x${NAME}_${VERSION_ID}/Release.key -O Release.key
apt-key add Release.key
apt-get update -qq
apt-get -qq -y install ${install_packages[@]}

View File

@@ -8,7 +8,7 @@ source_list=/etc/apt/sources.list.d/eslerlang.list
# Install Erlang
echo "deb https://binaries.erlang-solutions.com/debian $(lsb_release -cs) contrib" > $source_list
wget -O - https://binaries.erlang-solutions.com/debian/erlang_solutions.asc | apt-key add -
wget -q -O - https://binaries.erlang-solutions.com/debian/erlang_solutions.asc | apt-key add -
apt-get update
apt-get install -y --no-install-recommends esl-erlang

View File

@@ -4,6 +4,9 @@
## Desc: Installs Firefox
################################################################################
# Source the helpers for use with the script
source $HELPER_SCRIPTS/install.sh
# Install Firefox
apt-get install -y firefox
@@ -14,15 +17,13 @@ echo 'pref("intl.locale.requested","en_US");' >> "/usr/lib/firefox/browser/defau
# Download and unpack latest release of geckodriver
URL=$(curl -s https://api.github.com/repos/mozilla/geckodriver/releases/latest | jq -r '.assets[].browser_download_url | select(test("linux64.tar.gz$"))')
echo "Downloading geckodriver $URL"
wget "$URL" -O geckodriver.tar.gz
tar -xzf geckodriver.tar.gz
rm geckodriver.tar.gz
download_with_retries "$URL" "/tmp" geckodriver.tar.gz
GECKODRIVER_DIR="/usr/local/share/gecko_driver"
GECKODRIVER_BIN="$GECKODRIVER_DIR/geckodriver"
mkdir -p $GECKODRIVER_DIR
mv "geckodriver" $GECKODRIVER_BIN
tar -xzf /tmp/geckodriver.tar.gz -C $GECKODRIVER_DIR
chmod +x $GECKODRIVER_BIN
ln -s "$GECKODRIVER_BIN" /usr/bin/

View File

@@ -5,10 +5,12 @@
## Must be run as non-root user after homebrew
################################################################################
# Source the helpers for use with the script
source $HELPER_SCRIPTS/install.sh
# Install GitHub CLI
url=$(curl -s https://api.github.com/repos/cli/cli/releases/latest | jq -r '.assets[].browser_download_url|select(contains("linux") and contains("amd64") and contains(".deb"))')
wget $url
apt install ./gh_*_linux_amd64.deb
rm gh_*_linux_amd64.deb
download_with_retries $url "/tmp"
apt install /tmp/gh_*_linux_amd64.deb
invoke_tests "CLI.Tools" "GitHub CLI"

View File

@@ -71,7 +71,7 @@ ln -s /usr/share/apache-maven-3.6.3/bin/mvn /usr/bin/mvn
# The release download URL looks like this: https://services.gradle.org/distributions/gradle-5.2.1-bin.zip
# The release version is extracted from the download URL (i.e. 5.2.1).
# After all of this, the release is downloaded, extracted, a symlink is created that points to it, and GRADLE_HOME is set.
wget -O gradleReleases.html https://gradle.org/releases/
wget -qO gradleReleases.html https://gradle.org/releases/
gradleUrl=$(grep -m 1 -o "https:\/\/services.gradle.org\/distributions\/gradle-.*-bin\.zip" gradleReleases.html | head -1)
gradleVersion=$(echo $gradleUrl | sed -nre 's/^[^0-9]*(([0-9]+\.)*[0-9]+).*/\1/p')
rm gradleReleases.html

View File

@@ -4,12 +4,14 @@
## Desc: Installs PhantomJS
################################################################################
# Source the helpers for use with the script
source $HELPER_SCRIPTS/install.sh
# Install PhantomJS
apt-get install -y chrpath libssl-dev libxft-dev libfreetype6 libfreetype6-dev libfontconfig1 libfontconfig1-dev
PHANTOM_JS=phantomjs-2.1.1-linux-x86_64
wget https://bitbucket.org/ariya/phantomjs/downloads/$PHANTOM_JS.tar.bz2
tar xjf $PHANTOM_JS.tar.bz2
mv $PHANTOM_JS /usr/local/share
download_with_retries https://bitbucket.org/ariya/phantomjs/downloads/$PHANTOM_JS.tar.bz2 "/tmp"
tar xjf /tmp/$PHANTOM_JS.tar.bz2 -C /usr/local/share
ln -sf /usr/local/share/$PHANTOM_JS/bin/phantomjs /usr/local/bin
invoke_tests "Tools" "Phantomjs"

View File

@@ -4,6 +4,9 @@
## Desc: Installs selenium server
################################################################################
# Source the helpers for use with the script
source $HELPER_SCRIPTS/install.sh
# Determine latest selenium standalone server version
SELENIUM_LATEST_VERSION_URL=https://api.github.com/repos/SeleniumHQ/selenium/releases/latest
SELENIUM_VERSION=$(curl $SELENIUM_LATEST_VERSION_URL | jq '.name' | tr -d '"' | cut -d ' ' -f 2)
@@ -12,7 +15,7 @@ SELENIUM_VERSION_MAJOR_MINOR=$(echo $SELENIUM_VERSION | cut -d '.' -f 1,2)
# Download selenium standalone server
echo "Downloading selenium-server-standalone v$SELENIUM_VERSION..."
SELENIUM_JAR_NAME="selenium-server-standalone-$SELENIUM_VERSION.jar"
wget https://selenium-release.storage.googleapis.com/$SELENIUM_VERSION_MAJOR_MINOR/$SELENIUM_JAR_NAME
download_with_retries https://selenium-release.storage.googleapis.com/$SELENIUM_VERSION_MAJOR_MINOR/$SELENIUM_JAR_NAME
SELENIUM_JAR_PATH="/usr/share/java/selenium-server-standalone.jar"
mv $SELENIUM_JAR_NAME $SELENIUM_JAR_PATH