Skip to content

Commit 35a43d6

Browse files
authored
WIP: gitlab-ci (#2285)
* gitlab-ci new commit change script name new commit one more pull request still not exists?? move travis file next to gitlab config push new runner one more push he-he it must work fast in order to acheave good result docker build add chromedriver update package dont use selenium when chromedriver exists add chromedriver run the tests remotely add more tests fix small issue new changed at the same moment just only one docker install per system add interruptible=true find correct chromedriver cahe for docker must be global global cacke for all branches add path for chromedriver check e2e tests only 3 stages more robust config file correct cache correct cache fff all jobs are correct except pages he-he fix checking cache by docker-compose 2 steps all scripts new final steps added resorce group * gitlab-ci new commit change script name new commit one more pull request still not exists?? move travis file next to gitlab config push new runner one more push he-he it must work fast in order to acheave good result docker build add chromedriver update package dont use selenium when chromedriver exists add chromedriver run the tests remotely add more tests fix small issue new changed at the same moment just only one docker install per system add interruptible=true find correct chromedriver cahe for docker must be global global cacke for all branches add path for chromedriver check e2e tests only 3 stages more robust config file correct cache correct cache fff all jobs are correct except pages he-he fix checking cache by docker-compose 2 steps all scripts new final steps added resorce group * remove sass cache * package.json * fix sass issue * test such way * one more test * add node-fetch globally to server and now we can skip install for this step * install one package globally * install one package ignoring all the rest from package-lock.json * try to use ci instead of install * added one more step for cache * correct ci script * specify sertain directory to be sure, that cache will be stored in the correct dir * install is brining back * gitlab-ci -> gitlab-ci.example * remove useless code after understanding, that gitlab doesnt lead improvement to our system * remove useless strings
1 parent 4fffdd3 commit 35a43d6

8 files changed

+480
-289
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,5 +18,6 @@ build/
1818
*.scss.d.ts
1919
*.ps1
2020
.idea
21+
.npm
2122

2223
test/integration/.dist

.gitlab-ci.example.yml

Lines changed: 96 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,96 @@
1+
stages:
2+
- Install
3+
- Static Tests
4+
- e2e Tests
5+
- Build
6+
- After e2e Tests
7+
8+
cache:
9+
key: ${CI_COMMIT_REF_SLUG}
10+
paths:
11+
- .npm/
12+
13+
before_script:
14+
- npm -v
15+
- node -v
16+
- npm install --cache .npm --prefer-offline
17+
18+
Check Docker Compose:
19+
stage: Install
20+
interruptible: true
21+
resource_group: docker-compose
22+
before_script:
23+
- ''
24+
cache: {}
25+
script:
26+
- docker -v
27+
- docker-compose -v
28+
- echo "rebuild docker-compose ONLY if config was changed"
29+
- cmp --silent docker-compose.yml ~/.runner-cache/docker-compose.yml ||
30+
bash -c 'docker-compose down
31+
&& docker-compose build
32+
&& docker-compose -f docker-compose.yml -f docker-compose.docker.yml up -d
33+
&& mkdir -p ~/.runner-cache
34+
&& rm -rf ~/.runner-cache/docker-compose.yml
35+
&& cp docker-compose.yml ~/.runner-cache/'
36+
- bash -c 'while [[ "$(curl -s -o /dev/null -w ''%{http_code}'' 127.0.0.1:3000)" != "200" ]]; do
37+
if [[ $i < 31 ]] ;
38+
then i=$((i+1)) && sleep 5 && echo "slep... $i";
39+
else exit 1; fi
40+
; done'
41+
- npm install --no-package-lock --no-save --quiet node-fetch --prefer-offline
42+
- npm run service-status
43+
needs: []
44+
only:
45+
variables:
46+
- '$CI_EXTERNAL_PULL_REQUEST_IID == null'
47+
48+
Static Tests:
49+
stage: Static Tests
50+
interruptible: true
51+
script:
52+
- npm run lint -- --quiet
53+
- npm run test:unit -- --forceExit
54+
needs: []
55+
only:
56+
variables:
57+
- '$CI_EXTERNAL_PULL_REQUEST_IID == null'
58+
59+
e2e Tests:
60+
stage: e2e Tests
61+
interruptible: true
62+
script:
63+
- npm run test:i
64+
needs: ["Check Docker Compose"]
65+
when: on_success
66+
retry: 2
67+
only:
68+
variables:
69+
- '$CI_EXTERNAL_PULL_REQUEST_IID == null'
70+
71+
Test Docker Services:
72+
stage: After e2e Tests
73+
interruptible: true
74+
before_script:
75+
- ''
76+
cache: {}
77+
script:
78+
- npm install --no-package-lock --no-save --quiet node-fetch --prefer-offline
79+
- npm run service-status
80+
- ./scripts/checkDaos.sh
81+
needs: [ "e2e Tests" ]
82+
when: on_success
83+
retry: 2
84+
only:
85+
variables:
86+
- '$CI_EXTERNAL_PULL_REQUEST_IID == null'
87+
88+
Build:
89+
stage: Build
90+
interruptible: true
91+
script:
92+
- npm run build-travis
93+
needs: ["Static Tests"]
94+
only:
95+
variables:
96+
- '$CI_EXTERNAL_PULL_REQUEST_IID == null'

docker-compose.docker.yml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
version: "3"
2+
services:
3+
alchemy:
4+
restart: always
5+
6+
graph-node:
7+
restart: always
8+
9+
ipfs:
10+
restart: always
11+
12+
postgres:
13+
restart: always
14+
15+
ganache:
16+
restart: always

0 commit comments

Comments
 (0)