-
Notifications
You must be signed in to change notification settings - Fork 2
/
.gitlab-ci.yml
185 lines (170 loc) · 4.81 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
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
stages:
- test
- build
- deploy
.install-dependencies:
before_script:
- yarn install
.launch-benchmark-remote-data:
stage: test
image: ghcr.io/puppeteer/puppeteer:latest
script:
- |
for file in data-examples/*; do
if [ -f "$file" ]; then
if grep -q "localhost" "$file"; then
echo "Processing $file"
sed -i "s/localhost/${INFLUX_PROMETHEUS_SERVER}/g" "$file"
sed -i "s/'token'/'${INFLUX_TOKEN}'/g" "$file"
fi
fi
done
- yarn install --ignore-scripts
- |
yarn parcel dev/index.html --no-cache &
until curl -s http://localhost:1234 > /dev/null; do
echo "Waiting for Parcel server..."
sleep 1
done
- cd services/tsdbService
- yarn install
- |
yarn dev &
until curl -s http://localhost:9009 > /dev/null; do
echo "Waiting for palindrome service..."
sleep 1
done
- cd ../..
- node "$BENCHMARK_SCRIPT"
allow_failure: true
default:
image: node:18.18-alpine
cypress-test:
stage: test
extends: .install-dependencies
dependencies: []
image: cypress/base:latest
script:
- export NODE_OPTIONS=--openssl-legacy-provider & yarn run start-storybook -p 6006 &
- yarn run cross-env PALINDROME_TYPE=dev parcel dev/index.html --no-cache &
- rm -rf cypress/match-screenshots/ .cache/
- for i in 1 2; do yarn cypress:run; done
allow_failure: false
initial-remote-data-benchmark:
extends: .launch-benchmark-remote-data
before_script:
- export CI_BENCHMARK=remote_data
- export PALINDROME_TYPE=basic
- export BENCHMARK_SCRIPT=./scripts/remoteDataBenchmark/remoteDataBenchmark.js
remote-data-update-multiviewport-benchmark:
extends: .launch-benchmark-remote-data
before_script:
- export CI_BENCHMARK=multi-viewports
- export PALINDROME_TYPE=basic
- export BENCHMARK_SCRIPT=./scripts/remoteDataBenchmark/multiViewportBenchmark.js
benchmark:
image: cimg/node:18.0
stage: test
dependencies: []
before_script:
- sudo chown -R $(whoami):$(whoami) .
- !reference [.install-dependencies, before_script]
script:
- /bin/bash ./scripts/benchmark.sh "classic"
allow_failure: false
benchmark-test:
image: cimg/node:18.0
stage: test
dependencies: []
before_script:
- sudo chown -R $(whoami):$(whoami) .
- !reference [.install-dependencies, before_script]
script:
- /bin/bash ./scripts/benchmark.sh "evaluation"
allow_failure: false
build-dev:
stage: build
before_script:
- apk update
- apk add bash
- apk add git
script:
- yarn install
- yarn build
artifacts:
paths:
- "dist/"
allow_failure: false
build-storybook:
stage: build
before_script:
- apk update
- apk add bash
- apk add git
script:
- yarn install
- rm -rf stories/remote.stories.js
- file_path="stories/oth.stories.js"
- sed -i '/export const localLiveMonitoring = createPalindrome.bind({});/,/};/d' $file_path
- file_path="stories/mvp.stories.js"
- sed -i "/export const hybridMultiviewport = createMultipleViewPorts.bind({});/,/};/d" "$file_path"
- sed -i "/export const benchmarkMultiviewport = createMultipleViewPorts.bind({});/,/};/d" "$file_path"
- yarn build-storybook
artifacts:
paths:
- "storybook-static/"
allow_failure: false
pages:
stage: deploy
image: busybox
dependencies:
- build-dev
script:
- mv dist/ public/
artifacts:
paths:
- "public/"
allow_failure: false
when: manual
gh-pages:
stage: deploy
dependencies:
- build-dev
- build-storybook
before_script:
- apk update
- apk add bash
- apk add git
script:
- git config --global --add safe.directory '*'
- git remote set-url origin "https://${GITLAB_USER_NAME}:${GITLAB_GHPAGES_TOKEN}@${CI_SERVER_HOST}/${CI_PROJECT_PATH}.git"
- git config --global user.email "${GITLAB_USER_EMAIL}"
- git config --global user.name "${GITLAB_USER_NAME}"
- yarn install
- mv storybook-static/ dist/storybook/
- yarn dev-deploy
artifacts:
paths:
- "dist/"
allow_failure: false
when: manual
mirror-wiki:
stage: deploy
image:
entrypoint: ['']
name: alpine/git:latest
before_script:
- git clone "https://${GITLAB_USER_NAME}:${GITLAB_TOKEN}@${CI_SERVER_HOST}/${CI_PROJECT_PATH}.wiki.git" "${CI_COMMIT_SHA}"
- git config --global user.email "${GIT_USER_EMAIL:-$GITLAB_USER_EMAIL}"
- git config --global user.name "${GIT_USER_NAME:-$GITLAB_USER_NAME}"
script:
- cd "${CI_COMMIT_SHA}"
- rm -rf .git
- git init
- git config --global user.name "${GH_USERNAME}"
- git remote add origin "https://${GH_USERNAME}:${GH_TOKEN}@github.com/Smile-SA/palindrome.js.wiki.git"
- git add .
- git commit -m "wiki update"
- git push -f origin master
allow_failure: false
when: manual