Skip to content

Commit a4fc1a6

Browse files
committed
[CI] Install qaf and run directly
1 parent f8f8b68 commit a4fc1a6

File tree

2 files changed

+13
-20
lines changed

2 files changed

+13
-20
lines changed

.buildkite/create-serverless.sh

Lines changed: 10 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -2,44 +2,35 @@
22

33
set -euo pipefail
44

5-
export EC_REGISTER_BACKEND=buildkite
5+
export EC_REGISTER_BACKEND=local
66
export EC_ENV=qa
77
export EC_REGION=aws-eu-west-1
88
# Using BUILDKITE_JOB_ID for the name to make it unique:
99
export EC_PROJECT_NAME="$EC_PROJECT_PREFIX-$BUILDKITE_JOB_ID"
1010

1111
# fetch cloud creds used by qaf
1212
CLOUD_ACCESS_KEY=$(vault read -field="$EC_ENV" $CLOUD_CREDENTIALS_PATH)
13-
echo "{\"api_key\":{\"$EC_ENV\":\"$CLOUD_ACCESS_KEY\"}}" > "$(pwd)/cloud.json"
13+
echo "{\"api_key\":{\"$EC_ENV\":\"$CLOUD_ACCESS_KEY\"}}" > "~/.elastic/cloud.json"
1414

1515
echo -e "--- Buildkite: ${BUILDKITE}"
1616

17-
run_qaf() {
18-
cmd=$1
19-
docker run --rm \
20-
-e EC_REGISTER_BACKEND \
21-
-e EC_ENV \
22-
-e EC_REGION \
23-
-e EC_PROJECT_NAME \
24-
-e VAULT_TOKEN \
25-
-e "BUILDKITE=${BUILDKITE}" \
26-
-v "$(pwd)/cloud.json:/root/.elastic/cloud.json" \
27-
docker.elastic.co/appex-qa/qaf:latest \
28-
bash -c "$cmd"
29-
}
17+
git clone https://github.com/elastic/qaf
18+
pushd qaf
19+
pip install -e .
20+
popd
3021

3122
# ensure serverless instance is deleted even if script errors
3223
cleanup() {
3324
echo -e "--- :elasticsearch: :broom::sparkles: Tear down serverless instance $EC_PROJECT_NAME"
34-
run_qaf 'qaf elastic-cloud projects delete'
35-
rm -rf "$(pwd)/cloud.json"
25+
qaf elastic-cloud projects delete
26+
rm -rf "~/.elastic/cloud.json"
3627
}
3728
trap cleanup EXIT
3829

3930
echo -e "--- :elasticsearch: Start serverless instance $EC_PROJECT_NAME"
4031

41-
run_qaf "qaf elastic-cloud projects create --project-type elasticsearch"
42-
deployment=$(run_qaf "qaf elastic-cloud projects describe $EC_PROJECT_NAME --as-json --show-credentials")
32+
qaf elastic-cloud projects create --project-type elasticsearch
33+
deployment=$(qaf elastic-cloud projects describe $EC_PROJECT_NAME --as-json --show-credentials)
4334

4435
# Set ELASTICSEARCH_URL and API_KEY variables
4536
export ES_API_SECRET_KEY=$(echo "$deployment" | jq -r '.credentials.api_key')

.buildkite/pipeline.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,9 @@ steps:
5757
- with:
5858
ruby_source: 'jruby'
5959
ruby: '9.4'
60-
command: ./.buildkite/run-serverless-tests.sh
60+
commands:
61+
- mkdir ~/.elastic
62+
- ./.buildkite/run-serverless-tests.sh
6163
- wait: ~
6264
continue_on_failure: true
6365
- label: "Log Results"

0 commit comments

Comments
 (0)