[Ubuntu] Set flags for curl (#7993)

This commit is contained in:
Vasilii Polikarpov
2023-07-28 20:18:41 +02:00
committed by GitHub
parent 3c7978b116
commit 7e863227d7
26 changed files with 33 additions and 33 deletions

View File

@@ -40,4 +40,4 @@ apt-get install jq
# Install apt-fast using quick-install.sh # Install apt-fast using quick-install.sh
# https://github.com/ilikenwf/apt-fast # https://github.com/ilikenwf/apt-fast
bash -c "$(curl -sL https://raw.githubusercontent.com/ilikenwf/apt-fast/master/quick-install.sh)" bash -c "$(curl -fsSL https://raw.githubusercontent.com/ilikenwf/apt-fast/master/quick-install.sh)"

View File

@@ -72,7 +72,7 @@ get_github_package_download_url() {
local VERSION=$3 local VERSION=$3
local SEARCH_IN_COUNT="100" local SEARCH_IN_COUNT="100"
json=$(curl -sSL "https://api.github.com/repos/${REPO_ORG}/releases?per_page=${SEARCH_IN_COUNT}") json=$(curl -fsSL "https://api.github.com/repos/${REPO_ORG}/releases?per_page=${SEARCH_IN_COUNT}")
if [ -n "$VERSION" ]; then if [ -n "$VERSION" ]; then
tagName=$(echo $json | jq -r '.[] | select(.prerelease==false).tag_name' | sort --unique --version-sort | egrep -v ".*-[a-z]|beta" | egrep "\w*${VERSION}" | tail -1) tagName=$(echo $json | jq -r '.[] | select(.prerelease==false).tag_name' | sort --unique --version-sort | egrep -v ".*-[a-z]|beta" | egrep "\w*${VERSION}" | tail -1)

View File

@@ -5,7 +5,7 @@
################################################################################ ################################################################################
# Install Azure CLI (instructions taken from https://docs.microsoft.com/en-us/cli/azure/install-azure-cli) # Install Azure CLI (instructions taken from https://docs.microsoft.com/en-us/cli/azure/install-azure-cli)
curl -sL https://aka.ms/InstallAzureCLIDeb | sudo bash curl -fsSL https://aka.ms/InstallAzureCLIDeb | sudo bash
echo "azure-cli https://docs.microsoft.com/en-us/cli/azure/install-azure-cli-linux?pivots=apt" >> $HELPER_SCRIPTS/apt-sources.txt echo "azure-cli https://docs.microsoft.com/en-us/cli/azure/install-azure-cli-linux?pivots=apt" >> $HELPER_SCRIPTS/apt-sources.txt
rm -f /etc/apt/sources.list.d/azure-cli.list rm -f /etc/apt/sources.list.d/azure-cli.list
rm -f /etc/apt/sources.list.d/azure-cli.list.save rm -f /etc/apt/sources.list.d/azure-cli.list.save

View File

@@ -13,7 +13,7 @@ if command -v cmake; then
echo "cmake is already installed" echo "cmake is already installed"
else else
downloadUrl=$(get_github_package_download_url "Kitware/CMake" "endswith(\"inux-x86_64.sh\")") downloadUrl=$(get_github_package_download_url "Kitware/CMake" "endswith(\"inux-x86_64.sh\")")
curl -sL ${downloadUrl} -o cmakeinstall.sh \ curl -fsSL ${downloadUrl} -o cmakeinstall.sh \
&& chmod +x cmakeinstall.sh \ && chmod +x cmakeinstall.sh \
&& ./cmakeinstall.sh --prefix=/usr/local --exclude-subdir \ && ./cmakeinstall.sh --prefix=/usr/local --exclude-subdir \
&& rm cmakeinstall.sh && rm cmakeinstall.sh

View File

@@ -7,7 +7,7 @@
source $HELPER_SCRIPTS/install.sh source $HELPER_SCRIPTS/install.sh
# Retrieve the CLI versions and bundle tags of the latest two CodeQL bundles. # Retrieve the CLI versions and bundle tags of the latest two CodeQL bundles.
base_url="$(curl -sSL https://raw.githubusercontent.com/github/codeql-action/v2/src/defaults.json)" base_url="$(curl -fsSL https://raw.githubusercontent.com/github/codeql-action/v2/src/defaults.json)"
codeql_tag_name="$(echo "$base_url" | jq -r '.bundleVersion')" codeql_tag_name="$(echo "$base_url" | jq -r '.bundleVersion')"
codeql_cli_version="$(echo "$base_url" | jq -r '.cliVersion')" codeql_cli_version="$(echo "$base_url" | jq -r '.cliVersion')"
prior_codeql_tag_name="$(echo "$base_url" | jq -r '.priorBundleVersion')" prior_codeql_tag_name="$(echo "$base_url" | jq -r '.priorBundleVersion')"

View File

@@ -6,7 +6,7 @@
# Install docker-compose v1 from releases # Install docker-compose v1 from releases
URL="https://github.com/docker/compose/releases/download/1.29.2/docker-compose-Linux-x86_64" URL="https://github.com/docker/compose/releases/download/1.29.2/docker-compose-Linux-x86_64"
curl -L $URL -o /usr/local/bin/docker-compose curl -fsSL $URL -o /usr/local/bin/docker-compose
chmod +x /usr/local/bin/docker-compose chmod +x /usr/local/bin/docker-compose
invoke_tests "Tools" "Docker-compose v1" invoke_tests "Tools" "Docker-compose v1"

View File

@@ -52,7 +52,7 @@ fi
# Install amazon-ecr-credential-helper # Install amazon-ecr-credential-helper
aws_latest_release_url="https://api.github.com/repos/awslabs/amazon-ecr-credential-helper/releases/latest" aws_latest_release_url="https://api.github.com/repos/awslabs/amazon-ecr-credential-helper/releases/latest"
aws_helper_url=$(curl "${authString[@]}" -sL $aws_latest_release_url | jq -r '.body' | awk -F'[()]' '/linux-amd64/ {print $2}') aws_helper_url=$(curl "${authString[@]}" -fsSL $aws_latest_release_url | jq -r '.body' | awk -F'[()]' '/linux-amd64/ {print $2}')
download_with_retries "$aws_helper_url" "/usr/bin" docker-credential-ecr-login download_with_retries "$aws_helper_url" "/usr/bin" docker-credential-ecr-login
chmod +x /usr/bin/docker-credential-ecr-login chmod +x /usr/bin/docker-credential-ecr-login

View File

@@ -22,7 +22,7 @@ cat <<EOF >> /etc/gitconfig
EOF EOF
# Install git-lfs # Install git-lfs
curl -s $GIT_LFS_REPO/script.deb.sh | bash curl -fsSL $GIT_LFS_REPO/script.deb.sh | bash
apt-get install -y git-lfs apt-get install -y git-lfs
# Install git-ftp # Install git-ftp

View File

@@ -17,7 +17,7 @@ setEtcEnvironmentVariable "BOOTSTRAP_HASKELL_NONINTERACTIVE" $BOOTSTRAP_HASKELL_
setEtcEnvironmentVariable "GHCUP_INSTALL_BASE_PREFIX" $GHCUP_INSTALL_BASE_PREFIX setEtcEnvironmentVariable "GHCUP_INSTALL_BASE_PREFIX" $GHCUP_INSTALL_BASE_PREFIX
# Install GHCup # Install GHCup
curl --proto '=https' --tlsv1.2 -sSf https://get-ghcup.haskell.org | sh > /dev/null 2>&1 || true curl --proto '=https' --tlsv1.2 -fsSL https://get-ghcup.haskell.org | sh > /dev/null 2>&1 || true
export PATH="$ghcup_bin:$PATH" export PATH="$ghcup_bin:$PATH"
prependEtcEnvironmentPath $ghcup_bin prependEtcEnvironmentPath $ghcup_bin
@@ -39,6 +39,6 @@ chmod -R 777 $GHCUP_INSTALL_BASE_PREFIX/.ghcup
ln -s $GHCUP_INSTALL_BASE_PREFIX/.ghcup /etc/skel/.ghcup ln -s $GHCUP_INSTALL_BASE_PREFIX/.ghcup /etc/skel/.ghcup
# Install the latest stable release of haskell stack # Install the latest stable release of haskell stack
curl -sSL https://get.haskellstack.org/ | sh curl -fsSL https://get.haskellstack.org/ | sh
invoke_tests "Haskell" invoke_tests "Haskell"

View File

@@ -5,6 +5,6 @@
################################################################################ ################################################################################
# Install Heroku CLI # Install Heroku CLI
curl https://cli-assets.heroku.com/install.sh | sh curl -fsSL https://cli-assets.heroku.com/install.sh | sh
invoke_tests "Tools" "Heroku" invoke_tests "Tools" "Heroku"

View File

@@ -136,7 +136,7 @@ ln -s /usr/share/apache-maven-${mavenVersion}/bin/mvn /usr/bin/mvn
# Install Gradle # Install Gradle
# This script founds the latest gradle release from https://services.gradle.org/versions/all # This script founds the latest gradle release from https://services.gradle.org/versions/all
# The release is downloaded, extracted, a symlink is created that points to it, and GRADLE_HOME is set. # The release is downloaded, extracted, a symlink is created that points to it, and GRADLE_HOME is set.
gradleJson=$(curl -s https://services.gradle.org/versions/all) gradleJson=$(curl -fsSL https://services.gradle.org/versions/all)
gradleLatestVersion=$(echo ${gradleJson} | jq -r '.[] | select(.version | contains("-") | not).version' | sort -V | tail -n1) gradleLatestVersion=$(echo ${gradleJson} | jq -r '.[] | select(.version | contains("-") | not).version' | sort -V | tail -n1)
gradleDownloadUrl=$(echo ${gradleJson} | jq -r ".[] | select(.version==\"$gradleLatestVersion\") | .downloadUrl") gradleDownloadUrl=$(echo ${gradleJson} | jq -r ".[] | select(.version==\"$gradleLatestVersion\") | .downloadUrl")
echo "gradleUrl=${gradleDownloadUrl}" echo "gradleUrl=${gradleDownloadUrl}"

View File

@@ -8,7 +8,7 @@
source $HELPER_SCRIPTS/install.sh source $HELPER_SCRIPTS/install.sh
# get the latest julia version # get the latest julia version
json=$(curl -sL "https://julialang-s3.julialang.org/bin/versions.json") json=$(curl -fsSL "https://julialang-s3.julialang.org/bin/versions.json")
julia_version=$(echo $json | jq -r '.[].files[] | select(.triplet=="x86_64-linux-gnu" and (.version | contains("-") | not)).version' | sort -V | tail -n1) julia_version=$(echo $json | jq -r '.[].files[] | select(.triplet=="x86_64-linux-gnu" and (.version | contains("-") | not)).version' | sort -V | tail -n1)
# download julia archive # download julia archive

View File

@@ -9,24 +9,24 @@ source $HELPER_SCRIPTS/install.sh
# Install KIND # Install KIND
URL=$(get_github_package_download_url "kubernetes-sigs/kind" "contains(\"kind-linux-amd64\")") URL=$(get_github_package_download_url "kubernetes-sigs/kind" "contains(\"kind-linux-amd64\")")
curl -L -o /usr/local/bin/kind $URL curl -fsSL -o /usr/local/bin/kind $URL
chmod +x /usr/local/bin/kind chmod +x /usr/local/bin/kind
## Install kubectl ## Install kubectl
KUBECTL_VERSION=$(curl -L -s "https://dl.k8s.io/release/stable.txt") KUBECTL_VERSION=$(curl -fsSL "https://dl.k8s.io/release/stable.txt")
curl -o /usr/local/bin/kubectl -LO "https://dl.k8s.io/release/$KUBECTL_VERSION/bin/linux/amd64/kubectl" curl -fsSL -o /usr/local/bin/kubectl "https://dl.k8s.io/release/$KUBECTL_VERSION/bin/linux/amd64/kubectl"
chmod +x /usr/local/bin/kubectl chmod +x /usr/local/bin/kubectl
# Install Helm # Install Helm
curl https://raw.githubusercontent.com/helm/helm/master/scripts/get-helm-3 | bash curl -fsSL https://raw.githubusercontent.com/helm/helm/master/scripts/get-helm-3 | bash
# Install minikube # Install minikube
curl -LO https://storage.googleapis.com/minikube/releases/latest/minikube-linux-amd64 curl -fsSL -O https://storage.googleapis.com/minikube/releases/latest/minikube-linux-amd64
sudo install minikube-linux-amd64 /usr/local/bin/minikube sudo install minikube-linux-amd64 /usr/local/bin/minikube
# Install kustomize # Install kustomize
download_url="https://raw.githubusercontent.com/kubernetes-sigs/kustomize/master/hack/install_kustomize.sh" download_url="https://raw.githubusercontent.com/kubernetes-sigs/kustomize/master/hack/install_kustomize.sh"
curl -s "$download_url" | bash curl -fsSL "$download_url" | bash
mv kustomize /usr/local/bin mv kustomize /usr/local/bin
invoke_tests "Tools" "Kubernetes tools" invoke_tests "Tools" "Kubernetes tools"

View File

@@ -5,7 +5,7 @@
################################################################################ ################################################################################
LEIN_BIN=/usr/local/bin/lein LEIN_BIN=/usr/local/bin/lein
curl -s https://raw.githubusercontent.com/technomancy/leiningen/stable/bin/lein > $LEIN_BIN curl -fsSL https://raw.githubusercontent.com/technomancy/leiningen/stable/bin/lein > $LEIN_BIN
chmod 0755 $LEIN_BIN chmod 0755 $LEIN_BIN
# Run lein to trigger self-install # Run lein to trigger self-install

View File

@@ -35,7 +35,7 @@ EDGE_VERSION_MAJOR=$(echo $EDGE_VERSION | cut -d'.' -f 1)
EDGE_DRIVER_VERSION_URL="https://msedgedriver.azureedge.net/LATEST_RELEASE_${EDGE_VERSION_MAJOR}_LINUX" EDGE_DRIVER_VERSION_URL="https://msedgedriver.azureedge.net/LATEST_RELEASE_${EDGE_VERSION_MAJOR}_LINUX"
# Convert a resulting file to normal UTF-8 # Convert a resulting file to normal UTF-8
EDGE_DRIVER_LATEST_VERSION=$(curl -s "$EDGE_DRIVER_VERSION_URL" | iconv -f utf-16 -t utf-8 | tr -d '\r') EDGE_DRIVER_LATEST_VERSION=$(curl -fsSL "$EDGE_DRIVER_VERSION_URL" | iconv -f utf-16 -t utf-8 | tr -d '\r')
EDGEDRIVER_URL="https://msedgedriver.azureedge.net/${EDGE_DRIVER_LATEST_VERSION}/edgedriver_linux64.zip" EDGEDRIVER_URL="https://msedgedriver.azureedge.net/${EDGE_DRIVER_LATEST_VERSION}/edgedriver_linux64.zip"
download_with_retries $EDGEDRIVER_URL "/tmp" "edgedriver_linux64.zip" download_with_retries $EDGEDRIVER_URL "/tmp" "edgedriver_linux64.zip"

View File

@@ -5,7 +5,7 @@
################################################################################ ################################################################################
# Install Miniconda # Install Miniconda
curl -sL https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh -o miniconda.sh \ curl -fsSL https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh -o miniconda.sh \
&& chmod +x miniconda.sh \ && chmod +x miniconda.sh \
&& ./miniconda.sh -b -p /usr/share/miniconda \ && ./miniconda.sh -b -p /usr/share/miniconda \
&& rm miniconda.sh && rm miniconda.sh

View File

@@ -9,7 +9,7 @@ source $HELPER_SCRIPTS/install.sh
# Install default Node.js # Install default Node.js
defaultVersion=$(get_toolset_value '.node.default') defaultVersion=$(get_toolset_value '.node.default')
curl -L https://raw.githubusercontent.com/tj/n/master/bin/n -o ~/n curl -fsSL https://raw.githubusercontent.com/tj/n/master/bin/n -o ~/n
bash ~/n $defaultVersion bash ~/n $defaultVersion
# Install node modules # Install node modules

View File

@@ -6,8 +6,8 @@
export NVM_DIR="/etc/skel/.nvm" export NVM_DIR="/etc/skel/.nvm"
mkdir $NVM_DIR mkdir $NVM_DIR
VERSION=$(curl -s https://api.github.com/repos/nvm-sh/nvm/releases/latest | jq -r '.tag_name') VERSION=$(curl -fsSL https://api.github.com/repos/nvm-sh/nvm/releases/latest | jq -r '.tag_name')
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/$VERSION/install.sh | bash curl -fsSL https://raw.githubusercontent.com/nvm-sh/nvm/$VERSION/install.sh | bash
echo 'NVM_DIR=$HOME/.nvm' | tee -a /etc/environment echo 'NVM_DIR=$HOME/.nvm' | tee -a /etc/environment
echo '[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm' | tee -a /etc/skel/.bash_profile echo '[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm' | tee -a /etc/skel/.bash_profile
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"

View File

@@ -7,7 +7,7 @@
source $HELPER_SCRIPTS/install.sh source $HELPER_SCRIPTS/install.sh
# Install Packer # Install Packer
URL=$(curl -s https://api.releases.hashicorp.com/v1/releases/packer/latest | jq -r '.builds[] | select((.arch=="amd64") and (.os=="linux")).url') URL=$(curl -fsSL https://api.releases.hashicorp.com/v1/releases/packer/latest | jq -r '.builds[] | select((.arch=="amd64") and (.os=="linux")).url')
ZIP_NAME="packer_linux_amd64.zip" ZIP_NAME="packer_linux_amd64.zip"
download_with_retries "${URL}" "/tmp" "${ZIP_NAME}" download_with_retries "${URL}" "/tmp" "${ZIP_NAME}"
unzip -qq "/tmp/${ZIP_NAME}" -d /usr/local/bin unzip -qq "/tmp/${ZIP_NAME}" -d /usr/local/bin

View File

@@ -8,7 +8,7 @@
source $HELPER_SCRIPTS/install.sh source $HELPER_SCRIPTS/install.sh
# Install Pulumi # Install Pulumi
VERSION=$(curl --fail --silent -L "https://www.pulumi.com/latest-version") VERSION=$(curl -fsSL "https://www.pulumi.com/latest-version")
TARBALL_URL="https://get.pulumi.com/releases/sdk/pulumi-v${VERSION}-linux-x64.tar.gz" TARBALL_URL="https://get.pulumi.com/releases/sdk/pulumi-v${VERSION}-linux-x64.tar.gz"
download_with_retries ${TARBALL_URL} "/tmp" pulumi-v${VERSION}.tar.gz download_with_retries ${TARBALL_URL} "/tmp" pulumi-v${VERSION}.tar.gz
tar --strip=1 -xf /tmp/pulumi-v${VERSION}.tar.gz -C /usr/local/bin tar --strip=1 -xf /tmp/pulumi-v${VERSION}.tar.gz -C /usr/local/bin

View File

@@ -74,7 +74,7 @@ function InstallPyPy
} }
# Installation PyPy # Installation PyPy
pypyVersions=$(curl https://downloads.python.org/pypy/versions.json) pypyVersions=$(curl -fsSL https://downloads.python.org/pypy/versions.json)
toolsetVersions=$(get_toolset_value '.toolcache[] | select(.name | contains("PyPy")) | .versions[]') toolsetVersions=$(get_toolset_value '.toolcache[] | select(.name | contains("PyPy")) | .versions[]')
for toolsetVersion in $toolsetVersions; do for toolsetVersion in $toolsetVersions; do

View File

@@ -22,7 +22,7 @@ fi
apt-get install -y libz-dev openssl libssl-dev apt-get install -y libz-dev openssl libssl-dev
echo "Install Ruby from toolset..." echo "Install Ruby from toolset..."
PACKAGE_TAR_NAMES=$(curl -s "https://api.github.com/repos/ruby/ruby-builder/releases/latest" | jq -r '.assets[].name') PACKAGE_TAR_NAMES=$(curl -fsSL "https://api.github.com/repos/ruby/ruby-builder/releases/latest" | jq -r '.assets[].name')
TOOLSET_VERSIONS=$(get_toolset_value '.toolcache[] | select(.name | contains("Ruby")) | .versions[]') TOOLSET_VERSIONS=$(get_toolset_value '.toolcache[] | select(.name | contains("Ruby")) | .versions[]')
PLATFORM_VERSION=$(get_toolset_value '.toolcache[] | select(.name | contains("Ruby")) | .platform_version') PLATFORM_VERSION=$(get_toolset_value '.toolcache[] | select(.name | contains("Ruby")) | .platform_version')
RUBY_PATH="$AGENT_TOOLSDIRECTORY/Ruby" RUBY_PATH="$AGENT_TOOLSDIRECTORY/Ruby"

View File

@@ -11,7 +11,7 @@ source $HELPER_SCRIPTS/os.sh
export RUSTUP_HOME=/etc/skel/.rustup export RUSTUP_HOME=/etc/skel/.rustup
export CARGO_HOME=/etc/skel/.cargo export CARGO_HOME=/etc/skel/.cargo
curl https://sh.rustup.rs -sSf | sh -s -- -y --default-toolchain=stable --profile=minimal curl -fsSL https://sh.rustup.rs | sh -s -- -y --default-toolchain=stable --profile=minimal
# Initialize environment variables # Initialize environment variables
source $CARGO_HOME/env source $CARGO_HOME/env

View File

@@ -9,7 +9,7 @@ source $HELPER_SCRIPTS/install.sh
# Install # Install
image_label="$(lsb_release -rs)" image_label="$(lsb_release -rs)"
swift_version=$(curl -s "https://api.github.com/repos/apple/swift/releases/latest" | jq -r '.tag_name | match("[0-9.]+").string') swift_version=$(curl -fsSL "https://api.github.com/repos/apple/swift/releases/latest" | jq -r '.tag_name | match("[0-9.]+").string')
swift_tar_name="swift-$swift_version-RELEASE-ubuntu$image_label.tar.gz" swift_tar_name="swift-$swift_version-RELEASE-ubuntu$image_label.tar.gz"
swift_tar_url="https://swift.org/builds/swift-$swift_version-release/ubuntu${image_label//./}/swift-$swift_version-RELEASE/$swift_tar_name" swift_tar_url="https://swift.org/builds/swift-$swift_version-release/ubuntu${image_label//./}/swift-$swift_version-RELEASE/$swift_tar_name"

View File

@@ -7,7 +7,7 @@
source $HELPER_SCRIPTS/install.sh source $HELPER_SCRIPTS/install.sh
# Install Terraform # Install Terraform
URL=$(curl -s https://api.releases.hashicorp.com/v1/releases/terraform/latest | jq -r '.builds[] | select((.arch=="amd64") and (.os=="linux")).url') URL=$(curl -fsSL https://api.releases.hashicorp.com/v1/releases/terraform/latest | jq -r '.builds[] | select((.arch=="amd64") and (.os=="linux")).url')
ZIP_NAME="terraform_linux_amd64.zip" ZIP_NAME="terraform_linux_amd64.zip"
download_with_retries "${URL}" "/tmp" "${ZIP_NAME}" download_with_retries "${URL}" "/tmp" "${ZIP_NAME}"
unzip -qq "/tmp/${ZIP_NAME}" -d /usr/local/bin unzip -qq "/tmp/${ZIP_NAME}" -d /usr/local/bin

View File

@@ -8,7 +8,7 @@
source $HELPER_SCRIPTS/install.sh source $HELPER_SCRIPTS/install.sh
apt-get install -y liblz4-dev apt-get install -y liblz4-dev
release_tag=$(curl https://api.github.com/repos/facebook/zstd/releases/latest | jq -r '.tag_name') release_tag=$(curl -fsSL https://api.github.com/repos/facebook/zstd/releases/latest | jq -r '.tag_name')
zstd_tar_name=zstd-${release_tag//v}.tar.gz zstd_tar_name=zstd-${release_tag//v}.tar.gz
URL=https://github.com/facebook/zstd/releases/download/${release_tag}/${zstd_tar_name} URL=https://github.com/facebook/zstd/releases/download/${release_tag}/${zstd_tar_name}
download_with_retries "${URL}" "/tmp" "${zstd_tar_name}" download_with_retries "${URL}" "/tmp" "${zstd_tar_name}"