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: ""
|
|
|
|
K6_IMAGE: loadimpact/k6
|
2020-10-24 23:57:45 +05:30
|
|
|
K6_VERSION: 0.27.0
|
2020-07-28 23:09:34 +05:30
|
|
|
K6_TEST_FILE: github.com/loadimpact/k6/samples/http_get.js
|
|
|
|
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'
|