-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.gitlab-ci.yml
104 lines (97 loc) · 2.35 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
stages:
- build
- deploy
- metrics
- test
webpack-build:
image: node:lts-alpine
stage: build
artifacts:
untracked: true
paths:
- www/dist/
before_script:
- cd www
- npm install
script:
- npm run build
docker-build-prod:
image: docker:19.03.1
stage: deploy
services:
- docker:19.03.1-dind
variables:
DOCKER_HOST: tcp://docker:2375/
DOCKER_DRIVER: overlay2
DOCKER_TLS_CERTDIR: ""
dependencies:
- webpack-build
before_script:
- export DOCKER_BUILDKIT=1
- docker login docker.io -u $CI_REGISTRY_USER -p "$CI_REGISTRY_PASSWORD"
script:
- docker build -t $CI_REGISTRY_IMAGE -f Dockerfile.prod .
- docker tag $CI_REGISTRY_IMAGE $CI_REGISTRY_USER/$CI_REGISTRY_IMAGE:latest
- docker push $CI_REGISTRY_USER/$CI_REGISTRY_IMAGE
only:
- master
docker-build-dev:
image: docker:19.03.1
stage: deploy
services:
- docker:19.03.1-dind
variables:
DOCKER_HOST: tcp://docker:2375/
DOCKER_DRIVER: overlay2
DOCKER_TLS_CERTDIR: ""
dependencies:
- webpack-build
before_script:
- export DOCKER_BUILDKIT=1
- docker login docker.io -u $CI_REGISTRY_USER -p "$CI_REGISTRY_PASSWORD"
script:
- docker build -t $CI_REGISTRY_IMAGE -f Dockerfile.dev .
- docker tag $CI_REGISTRY_IMAGE $CI_REGISTRY_USER/$CI_REGISTRY_IMAGE:$CI_COMMIT_BRANCH
- docker push $CI_REGISTRY_USER/$CI_REGISTRY_IMAGE
except:
- master
lines-of-code:
allow_failure: true
image: node:lts-alpine
stage: metrics
artifacts:
untracked: true
paths:
- lines-of-code.txt
before_script:
- npm install -g sloc
script:
- sh ci-tests/lines-of-code/test.sh > lines-of-code.txt
only:
- master
size:
allow_failure: true
image: node:lts-alpine
stage: metrics
artifacts:
untracked: true
paths:
- size.txt
script:
- sh ci-tests/size/test.sh > size.txt
only:
- master
docker-run:
image: docker:19.03.1
stage: test
services:
- docker:19.03.1-dind
variables:
DOCKER_HOST: tcp://docker:2375/
DOCKER_DRIVER: overlay2
DOCKER_TLS_CERTDIR: ""
before_script:
- docker volume create config
script:
- docker pull fractava/fractava.com:$CI_COMMIT_BRANCH
- docker run -d --rm --name='WebserverTest' --net='bridge' -e TZ="Europe/Berlin" -p '800:80/tcp' -v config:'/config' fractava/fractava.com:$CI_COMMIT_BRANCH