forked from bodastage/bts-ce-web
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitlab-ci.yml
60 lines (48 loc) · 1.32 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
image: docker:latest
services:
- docker:dind
variables:
CONTAINER_IMAGE: registry.gitlab.com/$CI_PROJECT_PATH
DOCKER_HOST: tcp://docker:2375
DOCKER_DRIVER: overlay2
IMAGE_TAG: $CI_REGISTRY_IMAGE:$CI_COMMIT_REF_SLUG
NODEJS_VERSION: 8.12.0
NPM_VERSION: 6.4.1
cache:
key: ${CI_COMMIT_REF_SLUG}
paths:
- node_modules
- build
before_script:
- rm package-lock.json
- apk --no-cache add curl
- apk add nodejs nodejs-npm git
# - apk add nodejs=$NODEJS_VERSION nodejs-npm=$NPM_VERSION git
stages:
- install
- build
- test
- deploy
install_npm_modules:
stage: install
script:
- npm install
- npm install --force git+https://github.com/erssebaggala/layout.git
test_client:
stage: test
script:
# - npm run test
- echo "Run tests"
build_client:
stage: build
script:
- export NODE_OPTIONS=--max_old_space_size=4096
- unset CI
- npm run build
build_image:
stage: deploy
script:
- docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" $CI_REGISTRY
- docker build --cache-from $CONTAINER_IMAGE:latest --tag $CONTAINER_IMAGE:$CI_COMMIT_SHA --tag $CONTAINER_IMAGE:latest .
- docker push $CONTAINER_IMAGE:$CI_COMMIT_SHA
- docker push $CONTAINER_IMAGE:latest