scripts: update get-envoy script to download all binaries (#3886)

* scripts: update get-envoy script to download all binaries

* run download in parallel

* show errors
This commit is contained in:
Caleb Doxsey 2023-01-12 16:23:18 -07:00 committed by GitHub
parent 1e6a483ce9
commit 759a7782b0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -7,26 +7,31 @@ export PATH
_project_root="$(cd "$(dirname "${BASH_SOURCE[0]}")" >/dev/null 2>&1 && pwd)/.."
_envoy_version=1.24.0
_dir="$_project_root/pkg/envoy/files"
_target="${TARGET:-"$(go env GOOS)-$(go env GOARCH)"}"
_url="https://github.com/pomerium/envoy-binaries/releases/download/v${_envoy_version}/envoy-${_target}"
for _target in darwin-amd64 darwin-arm64 linux-amd64 linux-arm64; do
_url="https://github.com/pomerium/envoy-binaries/releases/download/v${_envoy_version}/envoy-${_target}"
curl \
--silent \
--fail \
--compressed \
--location \
--time-cond "$_dir/envoy-$_target" \
--output "$_dir/envoy-$_target" \
"$_url"
curl \
--silent \
--fail \
--show-error \
--compressed \
--location \
--time-cond "$_dir/envoy-$_target" \
--output "$_dir/envoy-$_target" \
"$_url" &
curl \
--silent \
--fail \
--compressed \
--location \
--time-cond "$_dir/envoy-$_target.sha256" \
--output "$_dir/envoy-$_target.sha256" \
"$_url.sha256"
curl \
--silent \
--fail \
--show-error \
--compressed \
--location \
--time-cond "$_dir/envoy-$_target.sha256" \
--output "$_dir/envoy-$_target.sha256" \
"$_url.sha256" &
echo "$_envoy_version" >"$_dir/envoy-$_target.version"
echo "$_envoy_version" >"$_dir/envoy-$_target.version"
done
wait