Skip to content

Commit a18428c

Browse files
committed
move credentials
1 parent 969f5d2 commit a18428c

File tree

2 files changed

+15
-7
lines changed

2 files changed

+15
-7
lines changed

.buildkite/hooks/pre-command

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,18 @@ if [[ "${USE_PROD_DOCKER_CREDENTIALS:-}" == "true" ]]; then
9494
fi
9595
fi
9696

97+
if [[ "${USE_PERF_CREDENTIALS:-}" == "true" ]]; then
98+
PERF_METRICS_HOST=$(vault read -field=es_host /secret/ci/elastic-elasticsearch/esbench-metics)
99+
PERF_METRICS_INDEX="dummy-micro-benchmarks"
100+
PERF_METRICS_USERNAME=$(vault read -field=es_username /secret/ci/elastic-elasticsearch/esbench-metics)
101+
PERF_METRICS_PASSWORD=$(vault read -field=es_password /secret/ci/elastic-elasticsearch/esbench-metics)
102+
103+
export METRICS_HOST
104+
export PERF_METRICS_INDEX
105+
export METRICS_USERNAME
106+
export METRICS_PASSWORD
107+
fi
108+
97109
# Authenticate to the Docker Hub public read-only registry
98110
if which docker > /dev/null 2>&1; then
99111
DOCKERHUB_REGISTRY_USERNAME="$(vault read -field=username secret/ci/elastic-elasticsearch/docker_hub_public_ro_credentials)"
Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,9 @@
11
#!/bin/bash
22

3-
METRICS_HOST=$(vault read -field=es_host /secret/performance/employees/cloud/esbench-metrics)
4-
METRICS_INDEX_NAME="dummy-micro-benchmarks"
5-
METRICS_USERNAME=$(vault read -field=es_username /secret/performance/employees/cloud/esbench-metrics)
6-
METRICS_PASSWORD=$(vault read -field=es_password /secret/performance/employees/cloud/esbench-metrics)
7-
83
jq -c '.[]' "benchmarks/build/result.json" | while read -r doc; do
9-
curl -s -X POST "https://$METRICS_HOST/$METRICS_INDEX_NAME/_doc" \
10-
-u "$METRICS_USERNAME:$METRICS_PASSWORD" \
4+
echo "Indexing $(echo "$doc" | jq -r '.benchmark')"
5+
curl -s -X POST "https://$PERF_METRICS_HOST/$PERF_METRICS_INDEX/_doc" \
6+
-u "$PERF_METRICS_USERNAME:$PERF_METRICS_PASSWORD" \
117
-H 'Content-Type: application/json' \
128
-d "$doc"
139
done

0 commit comments

Comments
 (0)