2021-09-30 23:02:18 +05:30
|
|
|
# To contribute improvements to CI/CD templates, please follow the Development guide at:
|
|
|
|
# https://docs.gitlab.com/ee/development/cicd/templates.html
|
|
|
|
# This specific template is located at:
|
|
|
|
# https://gitlab.com/gitlab-org/gitlab/-/blob/master/lib/gitlab/ci/templates/Verify/Browser-Performance.gitlab-ci.yml
|
|
|
|
|
2019-12-21 20:55:43 +05:30
|
|
|
# Read more about the feature here: https://docs.gitlab.com/ee/user/project/merge_requests/browser_performance_testing.html
|
|
|
|
|
|
|
|
stages:
|
|
|
|
- build
|
|
|
|
- test
|
|
|
|
- deploy
|
|
|
|
- performance
|
|
|
|
|
2021-09-04 01:27:46 +05:30
|
|
|
browser_performance:
|
2019-12-21 20:55:43 +05:30
|
|
|
stage: performance
|
|
|
|
image: docker:git
|
|
|
|
variables:
|
2020-07-28 23:09:34 +05:30
|
|
|
URL: ''
|
|
|
|
SITESPEED_IMAGE: sitespeedio/sitespeed.io
|
2020-11-24 15:15:51 +05:30
|
|
|
SITESPEED_VERSION: 14.1.0
|
2019-12-21 20:55:43 +05:30
|
|
|
SITESPEED_OPTIONS: ''
|
|
|
|
services:
|
|
|
|
- docker:stable-dind
|
|
|
|
script:
|
|
|
|
- mkdir gitlab-exporter
|
2021-04-29 21:17:54 +05:30
|
|
|
# Busybox wget does not support proxied HTTPS, get the real thing.
|
|
|
|
# See https://gitlab.com/gitlab-org/gitlab/-/issues/287611.
|
2022-05-07 20:08:51 +05:30
|
|
|
- (env | grep -i _proxy= >/dev/null 2>&1) && apk --no-cache add wget
|
2020-11-24 15:15:51 +05:30
|
|
|
- wget -O ./gitlab-exporter/index.js https://gitlab.com/gitlab-org/gl-performance/raw/1.1.0/index.js
|
2019-12-21 20:55:43 +05:30
|
|
|
- mkdir sitespeed-results
|
2021-04-29 21:17:54 +05:30
|
|
|
- |
|
|
|
|
function propagate_env_vars() {
|
|
|
|
CURRENT_ENV=$(printenv)
|
|
|
|
|
|
|
|
for VAR_NAME; do
|
|
|
|
echo $CURRENT_ENV | grep "${VAR_NAME}=" > /dev/null && echo "--env $VAR_NAME "
|
|
|
|
done
|
|
|
|
}
|
|
|
|
- |
|
|
|
|
docker run \
|
|
|
|
$(propagate_env_vars \
|
|
|
|
auto_proxy \
|
|
|
|
https_proxy \
|
|
|
|
http_proxy \
|
|
|
|
no_proxy \
|
|
|
|
AUTO_PROXY \
|
|
|
|
HTTPS_PROXY \
|
|
|
|
HTTP_PROXY \
|
|
|
|
NO_PROXY \
|
|
|
|
) \
|
|
|
|
--shm-size=1g --rm -v "$(pwd)":/sitespeed.io $SITESPEED_IMAGE:$SITESPEED_VERSION --plugins.add ./gitlab-exporter --cpu --outputFolder sitespeed-results $URL $SITESPEED_OPTIONS
|
2020-07-28 23:09:34 +05:30
|
|
|
- mv sitespeed-results/data/performance.json browser-performance.json
|
2019-12-21 20:55:43 +05:30
|
|
|
artifacts:
|
|
|
|
paths:
|
|
|
|
- sitespeed-results/
|
|
|
|
reports:
|
2020-07-28 23:09:34 +05:30
|
|
|
browser_performance: browser-performance.json
|