Skip to content

Commit

Permalink
Consolidate teardowns
Browse files Browse the repository at this point in the history
  • Loading branch information
NoahStapp committed Nov 25, 2024
1 parent 313f954 commit f4b9fad
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 12 deletions.
16 changes: 4 additions & 12 deletions .evergreen/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -519,7 +519,7 @@ functions:
- .evergreen/scripts/run-with-env.sh
- .evergreen/scripts/cleanup.sh

"teardown":
"teardown system":
- command: subprocess.exec
params:
binary: bash
Expand Down Expand Up @@ -601,20 +601,13 @@ functions:
args:
- src/.evergreen/scripts/stop-load-balancer.sh

"teardown_docker":
- command: subprocess.exec
params:
binary: bash
args:
- src/.evergreen/scripts/teardown-docker.sh

"teardown_aws":
"teardown":
- command: subprocess.exec
params:
binary: bash
args:
- src/.evergreen/scripts/run-with-env.sh
- src/.evergreen/scripts/teardown-aws.sh
- src/.evergreen/scripts/teardown.sh

"teardown atlas":
- command: subprocess.exec
Expand Down Expand Up @@ -652,14 +645,13 @@ pre:
post:
# Disabled, causing timeouts
# - func: "upload working dir"
- func: "teardown system"
- func: "teardown"
- func: "upload coverage"
- func: "upload mo artifacts"
- func: "upload test results"
- func: "stop mongo-orchestration"
- func: "teardown_aws"
- func: "cleanup"
- func: "teardown_docker"

task_groups:
- name: serverless_task_group
Expand Down
16 changes: 16 additions & 0 deletions .evergreen/scripts/teardown.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#!/bin/bash

# Teardown AWS
pushd "${DRIVERS_TOOLS}/.evergreen/auth_aws" || true
if [ -f "./aws_e2e_setup.json" ]; then
. ./activate-authawsvenv.sh
python ./lib/aws_assign_instance_profile.py
fi

popd || true

# Remove all Docker images
DOCKER=$(command -v docker) || true
if [ -n "$DOCKER" ]; then
docker rmi -f "$(docker images -a -q)" &> /dev/null || true
fi

0 comments on commit f4b9fad

Please sign in to comment.