-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy path.gitlab-ci.yml
70 lines (57 loc) · 1.96 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
stages:
- test
- build
- release
default:
tags:
- docker
variables:
PYTHON_IMAGE_TAG: 3.12.4-slim-bookworm
PYTHON_IMAGE_TAG_TESTONLY_3_11: 3.11.9-slim-bookworm
PYTHON_IMAGE_TAG_TESTONLY_3_10: 3.10.9-slim-buster
include:
- component: $CI_SERVER_FQDN/cm/rnd/cicd/component-python/[email protected]
inputs:
targets: ./cytomine_installer ./tests
pylintrc-path: pylintrc
pylint-version: 3.2.5
python-image-tag: ${PYTHON_IMAGE_TAG}
- component: $CI_SERVER_FQDN/cm/rnd/cicd/component-python/[email protected]
inputs:
unittest-job-name: unittest-python-3.12
target: ./tests
python-image-tag: ${PYTHON_IMAGE_TAG}
- component: $CI_SERVER_FQDN/cm/rnd/cicd/component-python/[email protected]
inputs:
unittest-job-name: unittest-python-3.11
target: ./tests
python-image-tag: ${PYTHON_IMAGE_TAG_TESTONLY_3_11}
- component: $CI_SERVER_FQDN/cm/rnd/cicd/component-docker/[email protected]
inputs:
docker-image-name: 'cytomine/installer'
dockerfile-path: './docker/Dockerfile'
- component: $CI_SERVER_FQDN/cm/rnd/cicd/component-docker/[email protected]
inputs:
push-latest-tag: "true"
.install-test-dependencies:
before_script:
- python -m pip install -r requirements.txt
unittest-python-3.12:
extends: .install-test-dependencies
unittest-python-3.11:
extends: .install-test-dependencies
build-docker-image:
rules:
- if: $CI_COMMIT_TAG
variables:
DOCKER_TAG: $CI_COMMIT_TAG
before_script:
- sed -i -- "s/__version__ = \"v0.0.0\"/__version__ = \"${DOCKER_TAG}\"/g" cytomine_installer/__version__.py
- export _ARGS=""
- _ARGS="${_ARGS} --build-arg IMAGE_VERSION=${DOCKER_TAG}"
- _ARGS="${_ARGS} --build-arg IMAGE_REVISION=${CI_COMMIT_SHORT_SHA}"
- _ARGS="${_ARGS} --build-arg PYTHON_VERSION=$(echo ${PYTHON_IMAGE_TAG} | awk -F'-' '{print $1}')"
- export DOCKER_BUILD_ARGS="$ARGS"
push-image-to-registry:
rules:
- if: $CI_COMMIT_TAG