Skip to content

Commit 9206f0b

Browse files
authored
bk: use elastic/vault-secrets and test-collector plugins together (elastic#8311)
1 parent 9259f35 commit 9206f0b

File tree

4 files changed

+10
-20
lines changed

4 files changed

+10
-20
lines changed

.buildkite/bk.integration.pipeline.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -451,7 +451,11 @@ steps:
451451
soft_fail:
452452
- exit_status: "*"
453453
plugins:
454-
- test-collector#v1.10.1:
454+
- elastic/vault-secrets#v0.1.0:
455+
path: "kv/ci-shared/platform-ingest/buildkite_analytics_token"
456+
field: "token"
457+
env_var: "BUILDKITE_ANALYTICS_TOKEN"
458+
- test-collector#v1.11.0:
455459
files: "build/*.xml"
456460
format: "junit"
457461
branches: "main"

.buildkite/hooks/pre-command

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -58,18 +58,6 @@ if [[ "$BUILDKITE_STEP_KEY" == *"integration-tests"* ]]; then
5858
export API_KEY_TOKEN=$(vault kv get -field apiKey ${CI_ESS_PATH})
5959
echo ${API_KEY_TOKEN} > ./apiKey
6060
export TEST_INTEG_AUTH_ESS_APIKEY_FILE=$(realpath ./apiKey)
61-
62-
# BK analytics
63-
echo "--- Prepare BK test analytics token :vault:"
64-
BUILDKITE_ANALYTICS_TOKEN=$(vault kv get -field token kv/ci-shared/platform-ingest/buildkite_analytics_token)
65-
export BUILDKITE_ANALYTICS_TOKEN
66-
fi
67-
68-
if [[ "$BUILDKITE_STEP_KEY" == *"aggregate-reports"* ]]; then
69-
# BK analytics
70-
echo "--- Prepare BK test analytics token :vault:"
71-
BUILDKITE_ANALYTICS_TOKEN=$(vault kv get -field token kv/ci-shared/platform-ingest/buildkite_analytics_token)
72-
export BUILDKITE_ANALYTICS_TOKEN
7361
fi
7462

7563
if [[ "$BUILDKITE_PIPELINE_SLUG" == "elastic-agent-binary-dra" ]]; then

.buildkite/scripts/steps/integration_tests_tf.sh

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -53,12 +53,6 @@ else
5353
export INTEGRATIONS_SERVER_HOST=$(buildkite-agent meta-data get "integrations_server.host")
5454
fi
5555

56-
# TODO: move to common.sh when it's refactored
57-
# BK analytics
58-
echo "--- Prepare BK test analytics token :vault:"
59-
BUILDKITE_ANALYTICS_TOKEN=$(vault kv get -field token kv/ci-shared/platform-ingest/buildkite_analytics_token)
60-
export BUILDKITE_ANALYTICS_TOKEN
61-
6256
# Run integration tests
6357
echo "~~~ Running integration tests"
6458

docs/test-framework-dev-guide.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -356,7 +356,11 @@ out weight the benefits of creating another group.
356356
machineType: "n1-standard-8"
357357
image: "family/platform-ingest-elastic-agent-ubuntu-2404"
358358
plugins:
359-
- test-collector#v1.10.1:
359+
- elastic/vault-secrets#v0.1.0:
360+
path: "kv/ci-shared/platform-ingest/buildkite_analytics_token"
361+
field: "token"
362+
env_var: "BUILDKITE_ANALYTICS_TOKEN"
363+
- test-collector#v1.11.0:
360364
files: "build/TEST-*.xml"
361365
format: "junit"
362366
branches: "main"

0 commit comments

Comments
 (0)