Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set proxy registry to bypass 429 issue (#1903) #1911

Merged
merged 1 commit into from
Jan 13, 2025
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
17 changes: 15 additions & 2 deletions test/e2e/Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,21 @@ class HarborChartFreshInstallPipelineExecutor extends FreshInstallPipelineExecut
script.file(credentialsId: "kubeconfig", variable: "KUBE_CONFIG_FILE_PATH"),
script.usernamePassword(credentialsId: "79e9fd98-cdf5-4f55-81fa-ecba01365534", usernameVariable: "DOCKER_HUB_USERNAME", passwordVariable: "DOCKER_HUB_PASSWORD")]) {
script.sh """
# login Docker Hub to avoid the pull limit
docker login -u \${DOCKER_HUB_USERNAME} -p \${DOCKER_HUB_PASSWORD}
# Set proxy registry or docker credential to bypass Docker Hub rate limit
echo "PROXY_REGISTRY is \${PROXY_REGISTRY}"
if [ "\${PROXY_REGISTRY}" != "" ]; then
# set deafult registry to a proxy registry
echo '{
"registry-mirrors": ["'"\${PROXY_REGISTRY}"'"]
}' | sudo tee /etc/docker/daemon.json > /dev/null

# Restart Docker to apply the changes
sudo systemctl reset-failed docker.service
sudo systemctl restart docker
else
docker login -u \${DOCKER_HUB_USERNAME} -p \${DOCKER_HUB_PASSWORD}
fi

# build the image
docker build -t deployer:dev -f test/e2e/Dockerfile test/e2e
# clean up the namespace
Expand Down
Loading