scripts: Pass --retry 3 to curl.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
This commit is contained in:
Anders Kaseorg 2022-11-07 13:50:24 -08:00 committed by Tim Abbott
parent c2cbc57bc4
commit fc9f23a85f
11 changed files with 13 additions and 13 deletions

View File

@ -8,7 +8,7 @@ tmpdir="$(mktemp -d)"
trap 'rm -r "$tmpdir"' EXIT trap 'rm -r "$tmpdir"' EXIT
cd "$tmpdir" cd "$tmpdir"
tarball="pgroonga-$version.tar.gz" tarball="pgroonga-$version.tar.gz"
curl -fLO "https://packages.groonga.org/source/pgroonga/$tarball" curl -fLO --retry 3 "https://packages.groonga.org/source/pgroonga/$tarball"
sha256sum -c <<<"$sha256 $tarball" sha256sum -c <<<"$sha256 $tarball"
tar -xzf "$tarball" tar -xzf "$tarball"
cd "pgroonga-$version" cd "pgroonga-$version"

View File

@ -24,7 +24,7 @@ if ! check_version 2>/dev/null; then
tmpdir="$(mktemp -d)" tmpdir="$(mktemp -d)"
trap 'rm -r "$tmpdir"' EXIT trap 'rm -r "$tmpdir"' EXIT
cd "$tmpdir" cd "$tmpdir"
curl_opts=(-fLO) curl_opts=(-fLO --retry 3)
if [ -n "${CUSTOM_CA_CERTIFICATES:-}" ]; then if [ -n "${CUSTOM_CA_CERTIFICATES:-}" ]; then
curl_opts+=(--cacert "${CUSTOM_CA_CERTIFICATES}") curl_opts+=(--cacert "${CUSTOM_CA_CERTIFICATES}")
fi fi

View File

@ -18,7 +18,7 @@ if ! check_version; then
tmpdir="$(mktemp -d)" tmpdir="$(mktemp -d)"
trap 'rm -r "$tmpdir"' EXIT trap 'rm -r "$tmpdir"' EXIT
cd "$tmpdir" cd "$tmpdir"
curl -fLO "https://registry.npmjs.org/yarn/-/$tarball" curl -fLO --retry 3 "https://registry.npmjs.org/yarn/-/$tarball"
sha256sum -c <<<"$sha256 $tarball" sha256sum -c <<<"$sha256 $tarball"
rm -rf /srv/zulip-yarn rm -rf /srv/zulip-yarn
mkdir /srv/zulip-yarn mkdir /srv/zulip-yarn

View File

@ -26,8 +26,8 @@ if [[ ! -e /usr/share/doc/groonga-apt-source/copyright ]]; then
} <<<"$os_info" } <<<"$os_info"
groonga_apt_source_deb="groonga-apt-source-latest-$release.deb" groonga_apt_source_deb="groonga-apt-source-latest-$release.deb"
groonga_apt_source_deb_sign="$groonga_apt_source_deb.asc.$pgroonga_apt_sign_key_fingerprint" groonga_apt_source_deb_sign="$groonga_apt_source_deb.asc.$pgroonga_apt_sign_key_fingerprint"
curl -fLO "https://packages.groonga.org/$distribution/$groonga_apt_source_deb" curl -fLO --retry 3 "https://packages.groonga.org/$distribution/$groonga_apt_source_deb"
curl -fLO "https://packages.groonga.org/$distribution/$groonga_apt_source_deb_sign" curl -fLO --retry 3 "https://packages.groonga.org/$distribution/$groonga_apt_source_deb_sign"
gpg \ gpg \
--homedir="$tmp_gpg_home" \ --homedir="$tmp_gpg_home" \
--verify \ --verify \

View File

@ -25,7 +25,7 @@ cd "$tmpdir"
# Fetch to a predictable name, not whatever curl guesses from the URL # Fetch to a predictable name, not whatever curl guesses from the URL
LOCALFILE="archive.tar.gz" LOCALFILE="archive.tar.gz"
curl -fL -o "$LOCALFILE" "$URL" curl -fL --retry 3 -o "$LOCALFILE" "$URL"
# Check the hash against what was passed in # Check the hash against what was passed in
echo "$SHA256 $LOCALFILE" >"$LOCALFILE.sha256" echo "$SHA256 $LOCALFILE" >"$LOCALFILE.sha256"

View File

@ -12,7 +12,7 @@ FROM $BASE_IMAGE
# Download the release tarball, start rabbitmq server and install the server # Download the release tarball, start rabbitmq server and install the server
ARG VERSION ARG VERSION
RUN cd $(mktemp -d) \ RUN cd $(mktemp -d) \
&& curl -fLO "https://download.zulip.com/server/zulip-server-$VERSION.tar.gz" \ && curl -fLO --retry 3 "https://download.zulip.com/server/zulip-server-$VERSION.tar.gz" \
&& tar -xf "zulip-server-$VERSION.tar.gz" \ && tar -xf "zulip-server-$VERSION.tar.gz" \
# Version 3.4 predates ddb9d16132a6336b384bf674c4c950cd75d83e5c and 9d57fa97597ec176a8357d6620ab9e670ee19f4e # Version 3.4 predates ddb9d16132a6336b384bf674c4c950cd75d83e5c and 9d57fa97597ec176a8357d6620ab9e670ee19f4e
&& perl -pi -e 's/pgrep -f epmd/which pgrep && pgrep -x epmd/' zulip-server-$VERSION/puppet/zulip/manifests/rabbit.pp \ && perl -pi -e 's/pgrep -f epmd/which pgrep && pgrep -x epmd/' zulip-server-$VERSION/puppet/zulip/manifests/rabbit.pp \

View File

@ -91,7 +91,7 @@ fi
# seems to require authentication even for simple lookups of public data, # seems to require authentication even for simple lookups of public data,
# and that'd be a pain for a simple script like this. # and that'd be a pain for a simple script like this.
pr_url=https://api.github.com/repos/"${repo_fq}"/pulls/"${pr_id}" pr_url=https://api.github.com/repos/"${repo_fq}"/pulls/"${pr_id}"
pr_details="$(curl -fLsS "$pr_url")" pr_details="$(curl -fLsS --retry 3 "$pr_url")"
pr_jq() { pr_jq() {
echo "$pr_details" | jq "$@" echo "$pr_details" | jq "$@"

View File

@ -19,7 +19,7 @@ if [ ! -d "/srv/zulip-aws-tools/v2/$AWS_CLI_VERSION" ]; then
( (
cd /srv/zulip-aws-tools || exit 1 cd /srv/zulip-aws-tools || exit 1
rm -rf awscli.zip awscli.zip.sha256 aws/ rm -rf awscli.zip awscli.zip.sha256 aws/
curl -fL "https://awscli.amazonaws.com/awscli-exe-linux-$ARCH-$AWS_CLI_VERSION.zip" -o awscli.zip curl -fL --retry 3 "https://awscli.amazonaws.com/awscli-exe-linux-$ARCH-$AWS_CLI_VERSION.zip" -o awscli.zip
echo "$AWS_CLI_SHA awscli.zip" >awscli.zip.sha256 echo "$AWS_CLI_SHA awscli.zip" >awscli.zip.sha256
sha256sum -c awscli.zip.sha256 sha256sum -c awscli.zip.sha256
unzip -q awscli.zip unzip -q awscli.zip

View File

@ -31,7 +31,7 @@ RUN \
# managed by systemd start within Docker, which breaks normal # managed by systemd start within Docker, which breaks normal
# operation of systemd. # operation of systemd.
dpkg-divert --add --rename /bin/systemctl \ dpkg-divert --add --rename /bin/systemctl \
&& curl -fLsS -o /bin/systemctl 'https://raw.githubusercontent.com/gdraheim/docker-systemctl-replacement/v1.5.4505/files/docker/systemctl3.py' \ && curl -fLsS --retry 3 -o /bin/systemctl 'https://raw.githubusercontent.com/gdraheim/docker-systemctl-replacement/v1.5.4505/files/docker/systemctl3.py' \
&& echo '93006382a98aadfd2490e521824fc870759732ff80cd012ce0dfc70d4225c803 /bin/systemctl' | sha256sum -c \ && echo '93006382a98aadfd2490e521824fc870759732ff80cd012ce0dfc70d4225c803 /bin/systemctl' | sha256sum -c \
&& chmod +x /bin/systemctl \ && chmod +x /bin/systemctl \
&& ln -nsf /bin/true /usr/sbin/policy-rc.d \ && ln -nsf /bin/true /usr/sbin/policy-rc.d \
@ -42,7 +42,7 @@ RUN \
# Set up the vagrant user and its SSH key (globally public) # Set up the vagrant user and its SSH key (globally public)
&& useradd -ms /bin/bash -u "$VAGRANT_UID" vagrant \ && useradd -ms /bin/bash -u "$VAGRANT_UID" vagrant \
&& mkdir -m 700 ~vagrant/.ssh \ && mkdir -m 700 ~vagrant/.ssh \
&& curl -fLsS -o ~vagrant/.ssh/authorized_keys 'https://raw.githubusercontent.com/hashicorp/vagrant/be7876d83644aa6bdf7f951592fdc681506bcbe6/keys/vagrant.pub' \ && curl -fLsS --retry 3 -o ~vagrant/.ssh/authorized_keys 'https://raw.githubusercontent.com/hashicorp/vagrant/be7876d83644aa6bdf7f951592fdc681506bcbe6/keys/vagrant.pub' \
&& chown -R vagrant: ~vagrant/.ssh \ && chown -R vagrant: ~vagrant/.ssh \
&& echo 'vagrant ALL=(ALL) NOPASSWD:ALL' > /etc/sudoers.d/vagrant && echo 'vagrant ALL=(ALL) NOPASSWD:ALL' > /etc/sudoers.d/vagrant

View File

@ -19,7 +19,7 @@ if ! check_version 2>/dev/null; then
tmpdir="$(mktemp -d)" tmpdir="$(mktemp -d)"
trap 'rm -r "$tmpdir"' EXIT trap 'rm -r "$tmpdir"' EXIT
cd "$tmpdir" cd "$tmpdir"
curl -fLO "https://github.com/koalaman/shellcheck/releases/download/v$version/$tarball" curl -fLO --retry 3 "https://github.com/koalaman/shellcheck/releases/download/v$version/$tarball"
sha256sum -c <<<"${sha256[$arch]} $tarball" sha256sum -c <<<"${sha256[$arch]} $tarball"
tar -xJf "$tarball" --no-same-owner --strip-components=1 -C /usr/local/bin "shellcheck-v$version/shellcheck" tar -xJf "$tarball" --no-same-owner --strip-components=1 -C /usr/local/bin "shellcheck-v$version/shellcheck"
check_version check_version

View File

@ -24,7 +24,7 @@ if ! check_version 2>/dev/null; then
tmpdir="$(mktemp -d)" tmpdir="$(mktemp -d)"
trap 'rm -r "$tmpdir"' EXIT trap 'rm -r "$tmpdir"' EXIT
cd "$tmpdir" cd "$tmpdir"
curl -fLO "https://github.com/mvdan/sh/releases/download/v$version/$binary" curl -fLO --retry 3 "https://github.com/mvdan/sh/releases/download/v$version/$binary"
sha256sum -c <<<"$sha256 $binary" sha256sum -c <<<"$sha256 $binary"
chmod +x "$binary" chmod +x "$binary"
mv "$binary" /usr/local/bin/shfmt mv "$binary" /usr/local/bin/shfmt