debian-mirror-gitlab/lib/gitlab/ci/templates/Jobs/Browser-Performance-Testing.gitlab-ci.yml

39 lines
1.4 KiB
YAML
Raw Normal View History

2019-07-07 11:18:12 +05:30
performance:
stage: performance
2020-06-23 00:09:42 +05:30
image: docker:19.03.11
2019-07-07 11:18:12 +05:30
allow_failure: true
2019-09-30 21:07:59 +05:30
variables:
DOCKER_TLS_CERTDIR: ""
2019-07-07 11:18:12 +05:30
services:
2020-06-23 00:09:42 +05:30
- docker:19.03.11-dind
2019-07-07 11:18:12 +05:30
script:
- |
if ! docker info &>/dev/null; then
if [ -z "$DOCKER_HOST" -a "$KUBERNETES_PORT" ]; then
export DOCKER_HOST='tcp://localhost:2375'
fi
fi
- export CI_ENVIRONMENT_URL=$(cat environment_url.txt)
- mkdir gitlab-exporter
2020-01-01 13:55:28 +05:30
- wget -O gitlab-exporter/index.js https://gitlab.com/gitlab-org/gl-performance/raw/1.0.0/index.js
2019-07-07 11:18:12 +05:30
- mkdir sitespeed-results
- |
if [ -f .gitlab-urls.txt ]
then
sed -i -e 's@^@'"$CI_ENVIRONMENT_URL"'@' .gitlab-urls.txt
2020-01-01 13:55:28 +05:30
docker run --shm-size=1g --rm -v "$(pwd)":/sitespeed.io sitespeedio/sitespeed.io:11.2.0 --plugins.add ./gitlab-exporter --outputFolder sitespeed-results .gitlab-urls.txt
2019-07-07 11:18:12 +05:30
else
2020-01-01 13:55:28 +05:30
docker run --shm-size=1g --rm -v "$(pwd)":/sitespeed.io sitespeedio/sitespeed.io:11.2.0 --plugins.add ./gitlab-exporter --outputFolder sitespeed-results "$CI_ENVIRONMENT_URL"
2019-07-07 11:18:12 +05:30
fi
- mv sitespeed-results/data/performance.json performance.json
artifacts:
paths:
2019-09-04 21:01:54 +05:30
- performance.json
- sitespeed-results/
2020-05-24 23:13:21 +05:30
rules:
- if: '$CI_KUBERNETES_ACTIVE == null || $CI_KUBERNETES_ACTIVE == ""'
when: never
- if: '$PERFORMANCE_DISABLED'
when: never
- if: '$CI_COMMIT_TAG || $CI_COMMIT_BRANCH'