mirror of
https://github.com/optim-enterprises-bv/vault.git
synced 2025-11-01 02:57:59 +00:00
add a retry-command script (#27754)
* add a retry-command script * add license header to retry script
This commit is contained in:
@@ -21,15 +21,15 @@ runs:
|
|||||||
- uses: ./.github/actions/set-up-staticcheck
|
- uses: ./.github/actions/set-up-staticcheck
|
||||||
# We assume that the Go toolchain will be managed by the caller workflow so we don't set one
|
# We assume that the Go toolchain will be managed by the caller workflow so we don't set one
|
||||||
# up here.
|
# up here.
|
||||||
- run: go install google.golang.org/protobuf/cmd/protoc-gen-go@latest
|
- run: ./.github/scripts/retry-command.sh go install google.golang.org/protobuf/cmd/protoc-gen-go@latest
|
||||||
shell: bash
|
shell: bash
|
||||||
- run: go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@latest
|
- run: ./.github/scripts/retry-command.sh go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@latest
|
||||||
shell: bash
|
shell: bash
|
||||||
- run: go install github.com/favadi/protoc-go-inject-tag@latest
|
- run: ./.github/scripts/retry-command.sh go install github.com/favadi/protoc-go-inject-tag@latest
|
||||||
shell: bash
|
shell: bash
|
||||||
- run: go install golang.org/x/tools/cmd/goimports@latest
|
- run: ./.github/scripts/retry-command.sh go install golang.org/x/tools/cmd/goimports@latest
|
||||||
shell: bash
|
shell: bash
|
||||||
- run: go install github.com/golangci/revgrep/cmd/revgrep@latest
|
- run: ./.github/scripts/retry-command.sh go install github.com/golangci/revgrep/cmd/revgrep@latest
|
||||||
shell: bash
|
shell: bash
|
||||||
- run: go install github.com/loggerhead/enumer@latest
|
- run: ./.github/scripts/retry-command.sh go install github.com/loggerhead/enumer@latest
|
||||||
shell: bash
|
shell: bash
|
||||||
|
|||||||
18
.github/scripts/retry-command.sh
vendored
Executable file
18
.github/scripts/retry-command.sh
vendored
Executable file
@@ -0,0 +1,18 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
# Copyright (c) HashiCorp, Inc.
|
||||||
|
# SPDX-License-Identifier: BUSL-1.1
|
||||||
|
set -euo pipefail
|
||||||
|
|
||||||
|
tries=5
|
||||||
|
count=0
|
||||||
|
|
||||||
|
until "$@"
|
||||||
|
do
|
||||||
|
if [ $count -eq $tries ]; then
|
||||||
|
echo "tried $count times, exiting"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
((count++))
|
||||||
|
echo "trying again, attempt $count"
|
||||||
|
sleep 2
|
||||||
|
done
|
||||||
Reference in New Issue
Block a user