-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.gitlab-ci.yml
37 lines (34 loc) · 952 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
variables:
DOCKER_DRIVER: overlay2 # use faster volume driver
DOCKER_IMAGE: registry.gitlab.com/publicmarket/open-inventory
stages:
- build
- test
build:
stage: build
tags:
- build
image: docker:latest
before_script:
- docker login -u gitlab-ci-token -p $CI_JOB_TOKEN registry.gitlab.com
script:
- docker build -t $DOCKER_IMAGE:latest .
- docker push $DOCKER_IMAGE:latest
# cleanup
- docker system prune -f
rspec:
image: $DOCKER_IMAGE:latest
stage: test
cache:
paths:
- cc-test-reporter
variables:
RAILS_ENV: test
before_script:
# setup codeclimate test reporter
- wget -nc -O ./cc-test-reporter https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 || true
- chmod +x ./cc-test-reporter
- ./cc-test-reporter before-build
script:
- bundle exec rspec
- ./cc-test-reporter after-build --coverage-input-type simplecov --exit-code $?