-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitlab-ci.yml
60 lines (53 loc) · 1.18 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: mikewilliamson/usesthis-ci
cache:
paths:
- node_modules
stages:
- test
- build
before_script:
- for dir in web api; do $(cd "$dir" && npm i --no-audit --silent >/dev/null 2>&1); done
test_api:
stage: test
services:
- name: mikewilliamson/arango-ci
alias: arangodb
script:
- cd api
- npm test
test_web:
stage: test
services:
- name: mikewilliamson/arango-ci
alias: arangodb
script:
- cd web
- npm test
build_api:
stage: build
image: docker:stable
services:
- docker:dind
variables:
DOCKER_DRIVER: overlay2
IMAGE_TAG: mikewilliamson/usesthis-api:$CI_COMMIT_SHA
before_script:
- echo $DOCKER_PASSWORD | docker login --username $DOCKER_USER --password-stdin
script:
- cd api
- docker build -t $IMAGE_TAG .
- docker push $IMAGE_TAG
build_web:
stage: build
image: docker:stable
services:
- docker:dind
variables:
DOCKER_DRIVER: overlay2
IMAGE_TAG: mikewilliamson/usesthis-web:$CI_COMMIT_SHA
before_script:
- echo $DOCKER_PASSWORD | docker login --username $DOCKER_USER --password-stdin
script:
- cd web
- docker build -t $IMAGE_TAG .
- docker push $IMAGE_TAG