Skip to content

Commit af9655c

Browse files
committed
Use artifactory mirror as docker registry
1 parent 117c32f commit af9655c

File tree

3 files changed

+23
-4
lines changed

3 files changed

+23
-4
lines changed

.evergreen/functions.yml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -600,11 +600,17 @@ functions:
600600
COMPASS_E2E_TEST_GROUPS: ${e2e_test_groups}
601601
COMPASS_E2E_TEST_GROUP: ${e2e_test_group}
602602
ATLAS_LOCAL_VERSION: latest
603+
ARTIFACTORY_USERNAME: ${artifactory_username}
604+
ARTIFACTORY_PASSWORD: ${artifactory_password}
605+
DOCKER_REGISTRY: artifactory.corp.mongodb.com
603606
script: |
604607
set -e
605608
# Load environment variables
606609
eval $(.evergreen/print-compass-env.sh)
607610
611+
# Authenticate with the Artifactory docker registry
612+
echo "${ARTIFACTORY_PASSWORD}" | docker login "${DOCKER_REGISTRY}" --username "${ARTIFACTORY_USERNAME}" --password-stdin
613+
608614
# Start atlas local to test Atlas Search
609615
source .evergreen/start-atlas-local.sh
610616
@@ -690,14 +696,24 @@ functions:
690696
MCLI_ORG_ID: ${e2e_tests_mcli_org_id}
691697
MCLI_PROJECT_ID: ${e2e_tests_mcli_project_id}
692698
MCLI_OPS_MANAGER_URL: ${e2e_tests_mcli_ops_manager_url}
699+
ARTIFACTORY_USERNAME: ${artifactory_username}
700+
ARTIFACTORY_PASSWORD: ${artifactory_password}
701+
DOCKER_REGISTRY: artifactory.corp.mongodb.com
693702
script: |
694703
set -e
704+
695705
# Load environment variables
696706
eval $(.evergreen/print-compass-env.sh)
707+
708+
# Authenticate with the Artifactory docker registry
709+
echo "${ARTIFACTORY_PASSWORD}" | docker login "${DOCKER_REGISTRY}" --username "${ARTIFACTORY_USERNAME}" --password-stdin
710+
697711
# Create Atlas cluster for test project
698712
source .evergreen/start-atlas-cloud-cluster.sh
713+
699714
# Run the tests
700715
echo "Starting e2e tests..."
716+
701717
# We're only running a special subset of tests as provisioning atlas
702718
# clusters in CI is both pricey and flakey, so we want to limit the
703719
# coverage to reduce those factors (at least for now)

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,14 +61,16 @@ ATLAS_CLUSTER_NAME="${_ATLAS_CLOUD_TEST_CLUSTER_NAME:-$DEFAULT_ATLAS_CLOUD_TEST_
6161
ATLAS_TEST_DB_USERNAME="testuser-$RUN_ID"
6262
ATLAS_TEST_DB_PASSWORD="$(head -c 32 /dev/urandom | base64 | tr -dc 'a-zA-Z0-9')"
6363

64+
DOCKER_REGISTRY="${DOCKER_REGISTRY-registry.hub.docker.com}"
65+
6466
function atlascli() {
6567
docker run \
6668
-e MCLI_PUBLIC_API_KEY \
6769
-e MCLI_PRIVATE_API_KEY \
6870
-e MCLI_ORG_ID \
6971
-e MCLI_PROJECT_ID \
7072
-e MCLI_OPS_MANAGER_URL \
71-
mongodb/atlas atlas $@
73+
$DOCKER_REGISTRY/library/mongodb/atlas atlas $@
7274
}
7375

7476
cleanup() {

.evergreen/start-atlas-local.sh

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,12 @@ cleanup() {
2020
trap cleanup EXIT
2121

2222
# Image name with version
23-
IMAGE_NAME="mongodb/mongodb-atlas-local:$ATLAS_LOCAL_VERSION"
24-
echo docker run --rm --name $CONTAINER_NAME -d -e DO_NOT_TRACK=1 -P "$IMAGE_NAME"
23+
DOCKER_REGISTRY="${DOCKER_REGISTRY-registry.hub.docker.com}"
24+
DOCKER_IMAGE="$DOCKER_REGISTRY/library/mongodb/mongodb-atlas-local:$ATLAS_LOCAL_VERSION"
25+
echo docker run --rm --name $CONTAINER_NAME -d -e DO_NOT_TRACK=1 -P "$DOCKER_IMAGE"
2526

2627
# Start the Docker container
27-
docker run --rm --name $CONTAINER_NAME -d -e DO_NOT_TRACK=1 -P "$IMAGE_NAME"
28+
docker run --rm --name $CONTAINER_NAME -d -e DO_NOT_TRACK=1 -P "$DOCKER_IMAGE"
2829

2930
echo "Waiting for container to become healthy..."
3031

0 commit comments

Comments
 (0)