forked from l3p-cv/lost
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitlab-ci.yml
53 lines (46 loc) · 1.6 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
image: docker:20.10.17
services:
- docker:20.10.17-dind
stages:
- build-lost-base
- build-lost
- test-lost
- release-lost
variables:
LOST_CI_REGISTRY_BASE_IMAGE: $CI_REGISTRY_BASE_IMAGE:3.13
LOST_CI_REGISTRY_GPU_BASE_IMAGE: $CI_REGISTRY_GPU_BASE_IMAGE:0.0
LOST_CI_REGISTRY_TEST_IMAGE: $CI_REGISTRY_TEST_IMAGE:$CI_PIPELINE_ID
LOST_CI_REGISTRY_IMAGE: $CI_REGISTRY_IMAGE:$CI_COMMIT_TAG
LOST_CI_REGISTRY_LOST_CV_GPU_IMAGE: $CI_REGISTRY_LOST_CV_GPU_IMAGE:$CI_COMMIT_TAG
LOST_VERSION: $CI_PIPELINE_ID
before_script:
- apk add --update nodejs npm
- docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" $CI_REGISTRY
build-lost-base:
stage: build-lost-base
script:
- docker build -t $LOST_CI_REGISTRY_BASE_IMAGE -f docker/lost-base/Dockerfile .
- docker push $LOST_CI_REGISTRY_BASE_IMAGE
only:
variables:
- $CI_COMMIT_MESSAGE =~ /lost-base/
build-lost:
stage: build-lost
script:
- docker build --build-arg LOST_VERSION=${CI_COMMIT_TAG} --build-arg base_image=$LOST_CI_REGISTRY_BASE_IMAGE --pull -t $LOST_CI_REGISTRY_TEST_IMAGE -f docker/lost/Dockerfile .
- docker push $LOST_CI_REGISTRY_TEST_IMAGE
test-lost:
stage: test-lost
before_script:
- apk add --no-cache --quiet py-pip
- pip install --quiet docker-compose~=1.23.0
script:
- cd docker/compose && docker-compose run -e LOST_VERSION=$LOST_VERSION lost bash /pytest.sh
release-lost:
stage: release-lost
script:
- docker pull $LOST_CI_REGISTRY_TEST_IMAGE
- docker tag $LOST_CI_REGISTRY_TEST_IMAGE $LOST_CI_REGISTRY_IMAGE
- docker push $LOST_CI_REGISTRY_IMAGE
only:
- tags