forked from l3p-cv/lost
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitlab-ci.yml
111 lines (101 loc) · 3.58 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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
image: docker:19.03
services:
- docker:19.03-dind
stages:
- build-lost-base
- build-lost-gpu-base
- build-lost
- test-lost
- build-lost-cv
- build-lost-cv-gpu
- release-lost
variables:
LOST_CI_REGISTRY_BASE_IMAGE: $CI_REGISTRY_BASE_IMAGE:0.1
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_IMAGE: $CI_REGISTRY_LOST_CV_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-gpu-base:
stage: build-lost-gpu-base
script:
- docker build -t $LOST_CI_REGISTRY_GPU_BASE_IMAGE -f docker/lost-gpu-base/Dockerfile .
- docker push $LOST_CI_REGISTRY_GPU_BASE_IMAGE
only:
variables:
- $CI_COMMIT_MESSAGE =~ /lost-gpu-base/
build-lost:
stage: build-lost
script:
- npm install --prefix frontend/lost/src/tools/sia -d
- npm install --prefix frontend/lost/src/components/pipeline -d
- npm install --prefix frontend/lost -d
- CI=false npm run build --prefix frontend/lost -d
- rm -rf frontend/lost/node_modules
- rm -rf frontend/lost/src/tools/sia/node_modules
- rm -rf frontend/lost/src/components/pipeline/node_modules
- docker build --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
except:
variables:
- $CI_COMMIT_MESSAGE =~ /lost-base/
- $CI_COMMIT_MESSAGE =~ /lost-gpu-base/
- $CI_COMMIT_MESSAGE =~ /lost-cv/
- $CI_COMMIT_MESSAGE =~ /lost-cv-gpu/
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
except:
variables:
- $CI_COMMIT_MESSAGE =~ /lost-base/
- $CI_COMMIT_MESSAGE =~ /lost-gpu-base/
- $CI_COMMIT_MESSAGE =~ /lost-cv/
- $CI_COMMIT_MESSAGE =~ /lost-cv-gpu/
build-lost-cv:
stage: build-lost-cv
script:
- docker build --build-arg base_image=$LOST_CI_REGISTRY_BASE_IMAGE --pull -t $LOST_CI_REGISTRY_LOST_CV_IMAGE -f docker/executors/lost-cv/Dockerfile .
- docker push $LOST_CI_REGISTRY_LOST_CV_IMAGE
only:
# variables:
# - $CI_COMMIT_MESSAGE =~ /lost-cv/
- tags
build-lost-cv-gpu:
stage: build-lost-cv-gpu
script:
- docker build --build-arg base_image=$LOST_CI_REGISTRY_GPU_BASE_IMAGE --pull -t $LOST_CI_REGISTRY_LOST_CV_GPU_IMAGE -f docker/executors/lost-cv-gpu/Dockerfile .
- docker push $LOST_CI_REGISTRY_LOST_CV_GPU_IMAGE
only:
# variables:
# - $CI_COMMIT_MESSAGE =~ /lost-cv/
- tags
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
except:
variables:
- $CI_COMMIT_MESSAGE =~ /lost-base/
- $CI_COMMIT_MESSAGE =~ /lost-gpu-base/
- $CI_COMMIT_MESSAGE =~ /lost-cv/
- $CI_COMMIT_MESSAGE =~ /lost-cv-gpu/