-
Notifications
You must be signed in to change notification settings - Fork 19
/
.gitlab-ci.yml
53 lines (48 loc) · 1.08 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
stages:
- build
- test
- release
variables:
DOCKER_HOST: tcp://docker:2375
# This will instruct Docker not to start over TLS.
DOCKER_TLS_CERTDIR: ""
DOCKER_DRIVER: overlay2
IMAGE_TAG: $CI_REGISTRY_IMAGE:$CI_COMMIT_REF_SLUG
LATEST_TAG: $CI_REGISTRY_IMAGE:latest
build:
image: docker:latest
stage: build
services:
- docker:dind
tags:
- gpu
script:
- docker login -u gitlab-ci-token -p $CI_JOB_TOKEN $CI_REGISTRY
- docker pull $IMAGE_TAG || docker pull $LATEST_TAG || true
- docker build --cache-from $IMAGE_TAG --cache-from $LATEST_TAG -t $IMAGE_TAG --build-arg APP_ENV=prod .
- docker push $IMAGE_TAG
test-cuda-gpu:
stage: test
image: $IMAGE_TAG
tags:
- gpu
script:
- nvidia-smi
test-sanity:
stage: test
image: $IMAGE_TAG
tags:
- gpu
script:
- salus-server --help
release:
stage: release
services:
- docker:dind
script:
- docker login -u gitlab-ci-token -p $CI_JOB_TOKEN $CI_REGISTRY
- docker pull $IMAGE_TAG
- docker tag $IMAGE_TAG $LATEST_TAG
- docker push $LATEST_TAG
only:
- master