2020-07-28 23:09:34 +05:30
|
|
|
load_performance:
|
|
|
|
stage: performance
|
2022-05-07 20:08:51 +05:30
|
|
|
image: docker:20.10.12
|
2020-07-28 23:09:34 +05:30
|
|
|
allow_failure: true
|
|
|
|
variables:
|
|
|
|
DOCKER_TLS_CERTDIR: ""
|
2023-03-04 22:38:38 +05:30
|
|
|
K6_IMAGE: grafana/k6
|
|
|
|
K6_VERSION: 0.41.0
|
2023-07-09 08:55:56 +05:30
|
|
|
K6_TEST_FILE: raw.githubusercontent.com/grafana/k6/master/examples/http_get.js
|
2020-07-28 23:09:34 +05:30
|
|
|
K6_OPTIONS: ''
|
2020-11-24 15:15:51 +05:30
|
|
|
K6_DOCKER_OPTIONS: ''
|
2020-07-28 23:09:34 +05:30
|
|
|
services:
|
2022-05-07 20:08:51 +05:30
|
|
|
- name: 'docker:20.10.12-dind'
|
|
|
|
command: ['--tls=false', '--host=tcp://0.0.0.0:2375']
|
2020-07-28 23:09:34 +05:30
|
|
|
script:
|
|
|
|
- |
|
|
|
|
if ! docker info &>/dev/null; then
|
2022-05-07 20:08:51 +05:30
|
|
|
if [ -z "$DOCKER_HOST" ] && [ -n "$KUBERNETES_PORT" ]; then
|
2020-07-28 23:09:34 +05:30
|
|
|
export DOCKER_HOST='tcp://localhost:2375'
|
|
|
|
fi
|
|
|
|
fi
|
2020-11-24 15:15:51 +05:30
|
|
|
- docker run --rm -v "$(pwd)":/k6 -w /k6 $K6_DOCKER_OPTIONS $K6_IMAGE:$K6_VERSION run $K6_TEST_FILE --summary-export=load-performance.json $K6_OPTIONS
|
2020-07-28 23:09:34 +05:30
|
|
|
artifacts:
|
|
|
|
reports:
|
|
|
|
load_performance: load-performance.json
|
|
|
|
rules:
|
2021-12-11 22:18:48 +05:30
|
|
|
- if: '($CI_KUBERNETES_ACTIVE == null || $CI_KUBERNETES_ACTIVE == "") && ($KUBECONFIG == null || $KUBECONFIG == "")'
|
2020-07-28 23:09:34 +05:30
|
|
|
when: never
|
|
|
|
- if: '$LOAD_PERFORMANCE_DISABLED'
|
|
|
|
when: never
|
|
|
|
- if: '$CI_COMMIT_TAG || $CI_COMMIT_BRANCH'
|