Skip to content

Commit

Permalink
add option
Browse files Browse the repository at this point in the history
Signed-off-by: yminer <[email protected]>
  • Loading branch information
yminer committed Jan 2, 2025
1 parent df09093 commit 4db3a7e
Showing 1 changed file with 12 additions and 9 deletions.
21 changes: 12 additions & 9 deletions test/e2e/Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -22,17 +22,20 @@ 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 deafult registry to a proxy registry
# Set proxy registry or docker credential to bypass Docker Hub rate limit
echo "PROXY_REGISTRY is \${PROXY_REGISTRY}"
echo '{
"registry-mirrors": ["'"\${PROXY_REGISTRY}"'"]
}' | sudo tee /etc/docker/daemon.json > /dev/null
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
# 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
Expand Down

0 comments on commit 4db3a7e

Please sign in to comment.