-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitlab-ci.yml
40 lines (35 loc) · 1.05 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
image: docker:stable
stages:
- tests
- build-requirements
- build-api
services:
- docker:dind
tests:
stage: tests
before_script:
- apk add py-pip python-dev libffi-dev openssl-dev gcc libc-dev make
- pip install docker-compose
script:
- docker-compose -f docker/docker-compose-offline.yml up -d
- docker exec -t docker_django_1 inv test
build requirements:
stage: build-requirements
variables:
SALICML_PROD_RELEASE_IMAGE: $CI_REGISTRY_IMAGE/salicml/requirements:latest
script:
- docker login -u "gitlab-ci-token" -p "$CI_JOB_TOKEN" $CI_REGISTRY
- docker build -f docker/Dockerfile.base -t $SALICML_PROD_RELEASE_IMAGE .
- docker push $SALICML_PROD_RELEASE_IMAGE
only:
- master
build api:
stage: build-api
variables:
SALICML_PROD_RELEASE_IMAGE: $CI_REGISTRY_IMAGE/salicml/api:latest
script:
- docker login -u "gitlab-ci-token" -p "$CI_JOB_TOKEN" $CI_REGISTRY
- docker build -f docker/Dockerfile -t $SALICML_PROD_RELEASE_IMAGE .
- docker push $SALICML_PROD_RELEASE_IMAGE
only:
- master