Skip to content
This repository was archived by the owner on Oct 28, 2024. It is now read-only.
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 8 additions & 12 deletions vars/dockerLogin.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -44,18 +44,14 @@ def call(Map params = [:]){
"DOCKER_PASSWORD=${dockerPassword}"
]) {
retry(3) {
try {
sh(label: "Docker login", script: """
set +x
host ${registry} 2>&1 > /dev/null
docker login -u "\${DOCKER_USER}" -p "\${DOCKER_PASSWORD}" "${registry}" 2>/dev/null
""")
} catch(e) {
// When running in the CI with multiple parallel stages
// the access could be considered as a DDOS attack. Let's sleep a bit if it fails.
sleep randomNumber(min: 5, max: 10)
throw e
}
// When running in the CI with multiple parallel stages
// the access could be considered as a DDOS attack.
sleep randomNumber(min: 5, max: 10)
sh(label: "Docker login", script: """
set +x
host ${registry} 2>&1 > /dev/null
docker login -u "\${DOCKER_USER}" -p "\${DOCKER_PASSWORD}" "${registry}" 2>/dev/null
""")
}
}
}
Expand Down