-
Notifications
You must be signed in to change notification settings - Fork 1
/
.gitlab-ci.yml
50 lines (40 loc) · 885 Bytes
/
.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
# Official framework image. Look for the different tagged releases at:
# https://hub.docker.com/r/library/node/tags/
image: simontegg/alpine-node-git
variables:
DOCKER_DRIVER: overlay
IMAGE_TAG: $CI_REGISTRY_IMAGE:$CI_COMMIT_REF_NAME
POSTGRES_DB: test
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
DATABASE_URL: postgresql://postgres:postgres@postgres/test
cache:
paths:
- node_modules/
stages:
- prep
- test
- build
build:
image: docker:latest
stage: build
services:
- docker:dind
script:
- docker login -u gitlab-ci-token -p $CI_JOB_TOKEN $CI_REGISTRY
- docker build -t $IMAGE_TAG .
- docker push $IMAGE_TAG
prep:
stage: prep
script:
- npm install
test_unit:
stage: test
script:
- npm test
test_integration:
stage: test
services:
- postgres:9.6-alpine
script:
- npm run test:integration