Skip to content

Commit 9053899

Browse files
committed
conditionally log into docker
1 parent 7913bbc commit 9053899

File tree

3 files changed

+12
-6
lines changed

3 files changed

+12
-6
lines changed

.evergreen/start-atlas-cloud-cluster.sh

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,8 +89,10 @@ cleanup() {
8989

9090
trap cleanup EXIT
9191

92-
echo "Logging in to docker"
93-
echo "${DOCKERHUB_PASSWORD}" | docker login -u ${DOCKERHUB_USERNAME} --password-stdin
92+
if [ -z "$DOCKERHUB_PASSWORD" ]; then
93+
echo "Logging in to docker"
94+
echo "${DOCKERHUB_PASSWORD}" | docker login -u ${DOCKERHUB_USERNAME} --password-stdin
95+
fi
9496

9597
echo "Allowing access from current ip..."
9698
atlascli accessList create \

.evergreen/start-atlas-local.sh

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,10 @@ cleanup() {
1919

2020
trap cleanup EXIT
2121

22-
echo "Logging in to docker"
23-
echo "${DOCKERHUB_PASSWORD}" | docker login -u ${DOCKERHUB_USERNAME} --password-stdin
22+
if [ -z "$DOCKERHUB_PASSWORD" ]; then
23+
echo "Logging in to docker"
24+
echo "${DOCKERHUB_PASSWORD}" | docker login -u ${DOCKERHUB_USERNAME} --password-stdin
25+
fi
2426

2527
# Image name with version
2628
IMAGE_NAME="mongodb/mongodb-atlas-local:$ATLAS_LOCAL_VERSION"

.evergreen/start-docker-envs.sh

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,10 @@ if [ "$HAS_DOCKER" = true ]; then
3333
docker version
3434
$DOCKER_COMPOSE version
3535

36-
echo "Logging in to docker"
37-
echo "${DOCKERHUB_PASSWORD}" | docker login -u ${DOCKERHUB_USERNAME} --password-stdin
36+
if [ -z "$DOCKERHUB_PASSWORD" ]; then
37+
echo "Logging in to docker"
38+
echo "${DOCKERHUB_PASSWORD}" | docker login -u ${DOCKERHUB_USERNAME} --password-stdin
39+
fi
3840

3941
echo "Starting test environments"
4042

0 commit comments

Comments
 (0)