-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitlab-ci.yml
98 lines (89 loc) · 2.07 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
image: node:10
variables:
GIT_SUBMODULE_STRATEGY: recursive
DOCKER_DRIVER: overlay
stages:
- install
- test
- release
#- pages
- deploy
- trigger
build:
stage: install
script:
- npm install
- npm install -g json-server
artifacts:
paths:
- node_modules
unit:
stage: test
image: martinnaughton/nightwatch-e2e-headless:java8
script:
- npm run unit
artifacts:
paths:
- test/unit/coverage/
dependencies:
- build
e2e:
stage: test
before_script:
- Xvfb :99 -screen 0 1024x768x16 &> xvfb.log &
- export DISPLAY=:99.0
- git clone https://github.com/lintol/jsonapi-server-mock-lintol.git
- npm install --prefix jsonapi-server-mock-lintol/
- npm start --prefix jsonapi-server-mock-lintol/ &
image: martinnaughton/nightwatch-e2e-headless:java8
script:
- npm run e2e
dependencies:
- build
#pages:
# stage: pages
# dependencies:
# - e2e
# - unit
# script:
# - mv test/unit/coverage/lcov-report/ public/
# artifacts:
# paths:
# - public
# expire_in: 30 days
# only:
# - master
release:
stage: release
script:
- npm run build
- echo "CI_BUILD_REF=$CI_BUILD_REF\nCI_COMMIT_SHA=$CI_COMMIT_SHA" > CI_BUILD_REF
artifacts:
paths:
- dist
- CI_BUILD_REF
dependencies:
- build
only:
- master
deploy:
image: garland/aws-cli-docker
stage: deploy
dependencies:
- release
script:
- tar -czf frontend-build.tgz dist
- aws --endpoint-url https://mo.ev.openindustry.in s3 cp --recursive dist s3://$AWS_FRONTEND_BUCKET/cdn/dist-$CI_COMMIT_SHA
- echo $CI_COMMIT_SHA | aws --endpoint-url https://mo.ev.openindustry.in s3 cp - s3://$AWS_FRONTEND_BUCKET/cdn/latest-commit
only:
- master
trigger:
image: odise/busybox-curl
stage: trigger
dependencies:
- release
script:
- echo curl -X POST -F token=$GITLAB_BACKEND_TRIGGER -F ref=$GITLAB_BACKEND_TRIGGER_REF $GITLAB_BACKEND_TRIGGER_URL
- curl -X POST -F token=$GITLAB_BACKEND_TRIGGER -F ref=$GITLAB_BACKEND_TRIGGER_REF $GITLAB_BACKEND_TRIGGER_URL
only:
- master