Skip to content

Commit

Permalink
add pre-exit buildkite hook for integration test cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
pchila committed Sep 22, 2023
1 parent 0ad7b4e commit d1b5049
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions .buildkite/hooks/pre-exit
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,14 @@ if command -v docker &>/dev/null; then
DOCKER_REGISTRY="docker.elastic.co"
docker logout $DOCKER_REGISTRY
fi

if [[ "$BUILDKITE_PIPELINE_SLUG" == "elastic-agent" && "$BUILDKITE_STEP_KEY" == "integration-tests" ]]; then
if [[ -z "${WORKSPACE-""}" ]]; then
WORKSPACE=$(git rev-parse --show-toplevel)
fi

source "${WORKSPACE}/.buildkite/scripts/common.sh"

# Perform cleanup of integration tests resources
TEST_INTEG_AUTH_ESS_REGION=azure-eastus2 SNAPSHOT=true mage integration:clean
fi

0 comments on commit d1b5049

Please sign in to comment.