-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.gitlab-ci.yml
75 lines (64 loc) · 2.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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
include:
- project: 'docker/process-webhooks'
file: '/gitlab/deploy.yml'
variables:
GIT_SUBMODULE_STRATEGY: recursive
PROJECT_TO_BE_DEPLOYED: 'docker/collserola/transcribe-service'
stages:
- test
- transcribe-models
- transcribe-service
- transcribe-batch
- deploy
test:
image: python:3.11.1-slim-bullseye
before_script:
- pip install nose2
stage: test
script:
- apt-get update && apt-get install make -y
- pip install -r transcribe-batch/requirements.txt
- cd transcribe-batch && nose2
transcribe-models:
before_script:
- docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" $CI_REGISTRY
image: docker:latest
services:
- docker:dind
stage: transcribe-models
script:
- export REPO_NAME=$CI_REGISTRY_IMAGE/transcribe-models
- export IMAGE_NAME=$REPO_NAME:$CI_COMMIT_REF_NAME
- export DOCKER_PATH=transcribe-batch/docker/Dockerfile-models
- docker build --cache-from $IMAGE_NAME --tag transcribe-models --tag $IMAGE_NAME . -f $DOCKER_PATH
- docker push $IMAGE_NAME
transcribe-service:
before_script:
- docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" $CI_REGISTRY
image: docker:latest
services:
- docker:dind
stage: transcribe-service
script:
- export REPO_NAME=$CI_REGISTRY_IMAGE/transcribe-service
- export IMAGE_NAME=$REPO_NAME:$CI_COMMIT_REF_NAME
- export DOCKER_PATH=transcribe-service/docker/Dockerfile
- docker build --cache-from $IMAGE_NAME --tag transcribe-service -f $DOCKER_PATH --tag $IMAGE_NAME .
- docker push $IMAGE_NAME
transcribe-batch:
before_script:
- docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" $CI_REGISTRY
image: docker:latest
services:
- docker:dind
stage: transcribe-batch
script:
- export REPO_NAME=$CI_REGISTRY_IMAGE/transcribe-batch
- export IMAGE_NAME=$REPO_NAME:$CI_COMMIT_REF_NAME
- export DOCKER_PATH=transcribe-batch/docker/Dockerfile
- docker build --cache-from $IMAGE_NAME -f $DOCKER_PATH --tag $IMAGE_NAME .
- docker push $IMAGE_NAME
deploy:
stage: deploy
extends:
.default-deploy