-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitlab-ci.yml
79 lines (68 loc) · 1.61 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
70
71
72
73
74
75
76
77
78
79
# Author: Jintao Zhang <[email protected]>
image: docker:18.06.1-ce
services:
- docker:19.03.5-dind
variables:
DOCKER_DRIVER: overlay2
IMAGE_NAME: $CI_REGISTRY/$CI_PROJECT_PATH
stages:
- run-perf
- compare
before_script:
- docker login -u gitlab-ci-token -p $CI_JOB_TOKEN $CI_REGISTRY
.perf_template: &perf_definition
script:
- cd $TARGET
- docker build -t "$IMAGE_NAME:$TARGET" .
- docker images
- mkdir -p build
#- docker push "$IMAGE_NAME:stretch-perf"
- docker run --rm -v $PWD/build:/host "$IMAGE_NAME:$TARGET" cp /app/$TARGET-py3.json /host/
- ls -al build/
stretch-perf:
stage: run-perf
variables:
TARGET: stretch-perf
script:
<<: *perf_definition
artifacts:
paths:
- stretch-perf/build/stretch-perf-py3.json
expire_in: 30d
slim-perf:
stage: run-perf
variables:
TARGET: slim-perf
script:
<<: *perf_definition
artifacts:
paths:
- slim-perf/build/slim-perf-py3.json
expire_in: 30d
alpine-perf:
stage: run-perf
variables:
TARGET: alpine-perf
script:
<<: *perf_definition
artifacts:
paths:
- alpine-perf/build/alpine-perf-py3.json
expire_in: 30d
compare:
stage: compare
image: python:3.7
before_script:
- ls **
script:
- python3 -m pip install pyperformance
- ls **
- python3 -m pyperf compare_to slim-perf/build/slim-perf-py3.json stretch-perf/build/stretch-perf-py3.json alpine-perf/build/alpine-perf-py3.json --table > result.txt
artifacts:
paths:
- result.txt
expire_in: 30d
after_script:
- ls **
after_script:
- docker logout $CI_REGISTRY