Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion .buildkite/hooks/pre-command
Original file line number Diff line number Diff line change
Expand Up @@ -34,14 +34,16 @@ if [[ "$BUILDKITE_PIPELINE_SLUG" == "elastic-agent-package" ]]; then
fi
fi

if [[ "$BUILDKITE_STEP_KEY" == *"integration-tests"* ]]; then
if [[ "$BUILDKITE_PIPELINE_SLUG" == "buildkite-elastic-agent-integration-matrix" ]]; then
echo "Setting credentials"
# Set GCP credentials
export GOOGLE_APPLICATION_GCP_SECRET=$(retry 5 vault kv get -format=json -field=data ${CI_GCP_OBS_PATH})
echo "${GOOGLE_APPLICATION_GCP_SECRET}" > ./gcp.json
export GOOGLE_APPLICATION_CREDENTIALS=$(realpath ./gcp.json)
export TEST_INTEG_AUTH_GCP_SERVICE_TOKEN_FILE=$(realpath ./gcp.json)
fi

if [[ "$BUILDKITE_STEP_KEY" == *"integration-tests"* ]]; then
# ESS credentials
export API_KEY_TOKEN=$(vault kv get -field apiKey ${CI_ESS_PATH})
echo ${API_KEY_TOKEN} > ./apiKey
Expand Down
4 changes: 2 additions & 2 deletions .buildkite/hooks/pre-exit
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,13 @@ if [[ "$BUILDKITE_STEP_KEY" == *"integration-tests"* ]]; then
SNAPSHOT=true mage integration:clean
fi

if [ -n "$GOOGLE_APPLICATION_CREDENTIALS" ]; then
if [ -n "${GOOGLE_APPLICATION_CREDENTIALS:-}" ]; then
if test -f "$GOOGLE_APPLICATION_CREDENTIALS"; then
rm $GOOGLE_APPLICATION_CREDENTIALS
fi
fi

if [ -n "$TEST_INTEG_AUTH_GCP_SERVICE_TOKEN_FILE" ]; then
if [ -n "${TEST_INTEG_AUTH_GCP_SERVICE_TOKEN_FILE:-}" ]; then
if test -f "$TEST_INTEG_AUTH_GCP_SERVICE_TOKEN_FILE"; then
rm $TEST_INTEG_AUTH_GCP_SERVICE_TOKEN_FILE
fi
Expand Down