[v11.1.x] CI: Update retry_command function (#93869)
* CI: Update retry_command function (#93863)
* baldm0mma/update args
* baldm0mma/update_args/ conflict
(cherry picked from commit b17b98aeb9)
* make drone
This commit is contained in:
+9
-9
@@ -3110,14 +3110,14 @@ steps:
|
|||||||
- echo "deb [signed-by=/etc/apt/keyrings/grafana.gpg] https://apt.grafana.com stable
|
- echo "deb [signed-by=/etc/apt/keyrings/grafana.gpg] https://apt.grafana.com stable
|
||||||
main" | tee -a /etc/apt/sources.list.d/grafana.list
|
main" | tee -a /etc/apt/sources.list.d/grafana.list
|
||||||
- 'echo "Step 5: Installing Grafana..."'
|
- 'echo "Step 5: Installing Grafana..."'
|
||||||
- for i in $(seq 1 10); do
|
- for i in $(seq 1 60); do
|
||||||
- ' if apt-get update >/dev/null 2>&1 && DEBIAN_FRONTEND=noninteractive apt-get
|
- ' if apt-get update >/dev/null 2>&1 && DEBIAN_FRONTEND=noninteractive apt-get
|
||||||
install -yq grafana=${TAG} >/dev/null 2>&1; then'
|
install -yq grafana=${TAG} >/dev/null 2>&1; then'
|
||||||
- ' echo "Command succeeded on attempt $i"'
|
- ' echo "Command succeeded on attempt $i"'
|
||||||
- ' break'
|
- ' break'
|
||||||
- ' else'
|
- ' else'
|
||||||
- ' echo "Attempt $i failed"'
|
- ' echo "Attempt $i failed"'
|
||||||
- ' if [ $i -eq 10 ]; then'
|
- ' if [ $i -eq 60 ]; then'
|
||||||
- ' echo ''All attempts failed'''
|
- ' echo ''All attempts failed'''
|
||||||
- ' exit 1'
|
- ' exit 1'
|
||||||
- ' fi'
|
- ' fi'
|
||||||
@@ -3160,13 +3160,13 @@ steps:
|
|||||||
- dnf list available grafana-${TAG}
|
- dnf list available grafana-${TAG}
|
||||||
- if [ $? -eq 0 ]; then
|
- if [ $? -eq 0 ]; then
|
||||||
- ' echo "Grafana package found in repository. Installing from repo..."'
|
- ' echo "Grafana package found in repository. Installing from repo..."'
|
||||||
- for i in $(seq 1 5); do
|
- for i in $(seq 1 60); do
|
||||||
- ' if dnf install -y --nogpgcheck grafana-${TAG} >/dev/null 2>&1; then'
|
- ' if dnf install -y --nogpgcheck grafana-${TAG} >/dev/null 2>&1; then'
|
||||||
- ' echo "Command succeeded on attempt $i"'
|
- ' echo "Command succeeded on attempt $i"'
|
||||||
- ' break'
|
- ' break'
|
||||||
- ' else'
|
- ' else'
|
||||||
- ' echo "Attempt $i failed"'
|
- ' echo "Attempt $i failed"'
|
||||||
- ' if [ $i -eq 5 ]; then'
|
- ' if [ $i -eq 60 ]; then'
|
||||||
- ' echo ''All attempts failed'''
|
- ' echo ''All attempts failed'''
|
||||||
- ' exit 1'
|
- ' exit 1'
|
||||||
- ' fi'
|
- ' fi'
|
||||||
@@ -3287,14 +3287,14 @@ steps:
|
|||||||
- echo "deb [signed-by=/etc/apt/keyrings/grafana.gpg] https://apt.grafana.com stable
|
- echo "deb [signed-by=/etc/apt/keyrings/grafana.gpg] https://apt.grafana.com stable
|
||||||
main" | tee -a /etc/apt/sources.list.d/grafana.list
|
main" | tee -a /etc/apt/sources.list.d/grafana.list
|
||||||
- 'echo "Step 5: Installing Grafana..."'
|
- 'echo "Step 5: Installing Grafana..."'
|
||||||
- for i in $(seq 1 10); do
|
- for i in $(seq 1 60); do
|
||||||
- ' if apt-get update >/dev/null 2>&1 && DEBIAN_FRONTEND=noninteractive apt-get
|
- ' if apt-get update >/dev/null 2>&1 && DEBIAN_FRONTEND=noninteractive apt-get
|
||||||
install -yq grafana=${TAG} >/dev/null 2>&1; then'
|
install -yq grafana=${TAG} >/dev/null 2>&1; then'
|
||||||
- ' echo "Command succeeded on attempt $i"'
|
- ' echo "Command succeeded on attempt $i"'
|
||||||
- ' break'
|
- ' break'
|
||||||
- ' else'
|
- ' else'
|
||||||
- ' echo "Attempt $i failed"'
|
- ' echo "Attempt $i failed"'
|
||||||
- ' if [ $i -eq 10 ]; then'
|
- ' if [ $i -eq 60 ]; then'
|
||||||
- ' echo ''All attempts failed'''
|
- ' echo ''All attempts failed'''
|
||||||
- ' exit 1'
|
- ' exit 1'
|
||||||
- ' fi'
|
- ' fi'
|
||||||
@@ -3338,13 +3338,13 @@ steps:
|
|||||||
- dnf list available grafana-${TAG}
|
- dnf list available grafana-${TAG}
|
||||||
- if [ $? -eq 0 ]; then
|
- if [ $? -eq 0 ]; then
|
||||||
- ' echo "Grafana package found in repository. Installing from repo..."'
|
- ' echo "Grafana package found in repository. Installing from repo..."'
|
||||||
- for i in $(seq 1 5); do
|
- for i in $(seq 1 60); do
|
||||||
- ' if dnf install -y --nogpgcheck grafana-${TAG} >/dev/null 2>&1; then'
|
- ' if dnf install -y --nogpgcheck grafana-${TAG} >/dev/null 2>&1; then'
|
||||||
- ' echo "Command succeeded on attempt $i"'
|
- ' echo "Command succeeded on attempt $i"'
|
||||||
- ' break'
|
- ' break'
|
||||||
- ' else'
|
- ' else'
|
||||||
- ' echo "Attempt $i failed"'
|
- ' echo "Attempt $i failed"'
|
||||||
- ' if [ $i -eq 5 ]; then'
|
- ' if [ $i -eq 60 ]; then'
|
||||||
- ' echo ''All attempts failed'''
|
- ' echo ''All attempts failed'''
|
||||||
- ' exit 1'
|
- ' exit 1'
|
||||||
- ' fi'
|
- ' fi'
|
||||||
@@ -5351,6 +5351,6 @@ kind: secret
|
|||||||
name: gcr_credentials
|
name: gcr_credentials
|
||||||
---
|
---
|
||||||
kind: signature
|
kind: signature
|
||||||
hmac: 71fb0119e2c781ccb3f43f8207ccd54d240fd2b9f3a15f8e1a0fbfaf19f964f4
|
hmac: dd2822ec6136f460ca52714da83f46d11e22ac3717fa0b222899b69f4afd74c3
|
||||||
|
|
||||||
...
|
...
|
||||||
|
|||||||
@@ -1240,7 +1240,7 @@ def verify_linux_DEB_packages_step(depends_on = []):
|
|||||||
'echo "deb [signed-by=/etc/apt/keyrings/grafana.gpg] https://apt.grafana.com stable main" | tee -a /etc/apt/sources.list.d/grafana.list',
|
'echo "deb [signed-by=/etc/apt/keyrings/grafana.gpg] https://apt.grafana.com stable main" | tee -a /etc/apt/sources.list.d/grafana.list',
|
||||||
'echo "Step 5: Installing Grafana..."',
|
'echo "Step 5: Installing Grafana..."',
|
||||||
# The packages take a bit of time to propogate within the repo. This retry will check their availability within 10 minutes.
|
# The packages take a bit of time to propogate within the repo. This retry will check their availability within 10 minutes.
|
||||||
] + retry_command(install_command, attempts = 10) + [
|
] + retry_command(install_command) + [
|
||||||
'echo "Step 6: Verifying Grafana installation..."',
|
'echo "Step 6: Verifying Grafana installation..."',
|
||||||
'if dpkg -s grafana | grep -q "Version: ${TAG}"; then',
|
'if dpkg -s grafana | grep -q "Version: ${TAG}"; then',
|
||||||
' echo "Successfully verified Grafana version ${TAG}"',
|
' echo "Successfully verified Grafana version ${TAG}"',
|
||||||
@@ -1266,7 +1266,7 @@ def verify_linux_RPM_packages_step(depends_on = []):
|
|||||||
"sslcacert=/etc/pki/tls/certs/ca-bundle.crt\n"
|
"sslcacert=/etc/pki/tls/certs/ca-bundle.crt\n"
|
||||||
)
|
)
|
||||||
|
|
||||||
repo_install_command = "dnf install -y --nogpgcheck grafana-${TAG} >/dev/null 2>&1"
|
install_command = "dnf install -y --nogpgcheck grafana-${TAG} >/dev/null 2>&1"
|
||||||
|
|
||||||
return {
|
return {
|
||||||
"name": "verify-linux-RPM-packages",
|
"name": "verify-linux-RPM-packages",
|
||||||
@@ -1285,7 +1285,7 @@ def verify_linux_RPM_packages_step(depends_on = []):
|
|||||||
"dnf list available grafana-${TAG}",
|
"dnf list available grafana-${TAG}",
|
||||||
"if [ $? -eq 0 ]; then",
|
"if [ $? -eq 0 ]; then",
|
||||||
' echo "Grafana package found in repository. Installing from repo..."',
|
' echo "Grafana package found in repository. Installing from repo..."',
|
||||||
] + retry_command(repo_install_command, attempts = 5) + [
|
] + retry_command(install_command) + [
|
||||||
' echo "Verifying GPG key..."',
|
' echo "Verifying GPG key..."',
|
||||||
" rpm --import https://rpm.grafana.com/gpg.key",
|
" rpm --import https://rpm.grafana.com/gpg.key",
|
||||||
" rpm -qa gpg-pubkey* | xargs rpm -qi | grep -i grafana",
|
" rpm -qa gpg-pubkey* | xargs rpm -qi | grep -i grafana",
|
||||||
|
|||||||
Reference in New Issue
Block a user