-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitlab-ci.yml
69 lines (62 loc) · 2.38 KB
/
.gitlab-ci.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
.test-loadtesting-template:
variables:
YC_LT_AUTHORIZED_KEY_JSON: ${YC_LOADTESTING_CI_AUTHORIZED_KEY_JSON}
YC_LT_FOLDER_ID: '###SECRET###'
before_script:
- if [[ -z $YC_LT_AUTHORIZED_KEY_JSON ]]; then exit 1; fi
- if [[ -z $YC_LT_FOLDER_ID ]]; then exit 1; fi
# ----------------------------- install utilities ---------------------------- #
- DEBIAN_FRONTEND=noninteractive apt update
- DEBIAN_FRONTEND=noninteractive apt install -y curl jq
- curl -f -s -LO https://storage.yandexcloud.net/yandexcloud-yc/install.sh
- bash install.sh -i /usr/local/yandex-cloud -n
- ln -sf /usr/local/yandex-cloud/bin/yc /usr/local/bin/yc
# ----------------------------- configure yc cli ----------------------------- #
- echo "${YC_LT_AUTHORIZED_KEY_JSON}" > key.json
- yc config profile create sa-profile
- yc config set service-account-key key.json
- yc config set format json
- yc config set folder-id ${YC_LT_FOLDER_ID}
stages:
- test-loadtesting
- test-loadtesting-cleanup
test-loadtesting-create-agents:
extends: .test-loadtesting-template-job
stage: test-loadtesting
script:
- set -e
- automation/agent.sh create --count 2 \
--description "CI agent" \
--labels "pipeline=${CI_PIPELINE_IID}" \
--service-account-id "###SECRET###" \
--zone "###SECRET###" \
--network-interface "subnet-id=###SECRET###,security-group-ids=###SECRET###" \
--cores 2 \
--memory 2G
test-loadtesting-run:
extends: .test-loadtesting-template-job
stage: test-loadtesting
needs: [test-loadtesting-create-agents]
resource_group: loadtesting
script:
- set -e
- export YC_LT_TARGET="###SECRET###"
- export YC_LT_DATA_BUCKET="###SECRET###"
- export YC_LT_TEST_AGENT_FILTER="labels.pipeline = '${CI_PIPELINE_IID}'"
- export YC_LT_TEST_EXTRA_DESCRIPTION="GitLab CI url - ${CI_PIPELINE_URL}"
- automation/test.sh \
sample-tests/smoke \
sample-tests/mixed-synthetic-payload \
sample-tests/mixed-irl-payload \
sample-tests/mixed-irl-payload-multi \
sample-tests/root-const \
sample-tests/root-imbalance
test-loadtesting-delete-agents:
extends: .test-loadtesting-template-job
stage: test-loadtesting-cleanup
when: always
interruptible: false
script:
- set -e
- automation/agent.sh delete \
--labels "pipeline=${CI_PIPELINE_IID}"