-
Notifications
You must be signed in to change notification settings - Fork 2
/
.gitlab-ci.yml
52 lines (47 loc) · 1.67 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
---
# To contribute improvements to CI/CD templates, please follow the Development guide at:
# https://docs.gitlab.com/ee/development/cicd/templates.html
# This specific template is located at:
# https://gitlab.com/gitlab-org/gitlab/-/blob/master/lib/gitlab/ci/templates/Python.gitlab-ci.yml
include:
- project: nci-gdc/gitlab-templates
ref: 0.1.0
file:
- templates/global/full.yaml
- templates/python/full.yaml
variables:
BASE_CONTAINER_VERSION: "2.0.1"
DOCKER_BUILDKIT: 1
PIP_EXTRA_INDEX_URL: https://nexus.osdc.io/repository/pypi-all/simple
DOCKER_BUILD_OPTS: "--build-arg PIP_EXTRA_INDEX_URL=https://nexus.osdc.io/repository/pypi-all/simple"
tox:
image: ${BASE_CONTAINER_REGISTRY}/${REPO_PY_VERSION}-builder:${BASE_CONTAINER_VERSION}
before_script:
- mkdir -p /usr/share/man/man1
release:
image: ${BASE_CONTAINER_REGISTRY}/${REPO_PY_VERSION}-builder:${BASE_CONTAINER_VERSION}
.python_versions:
parallel:
matrix:
- REPO_PY_VERSION: [python3.8]
docker_build:
rules:
- if: $CI_COMMIT_TAG
variables:
DOCKER_RELEASE_REGISTRY: "quay.io/ncigdc"
- if: $CI_COMMIT_REF_NAME =~ /main/
variables:
DOCKER_RELEASE_REGISTRY: "quay.io/ncigdc"
- if: $CI_COMMIT_REF_NAME == $CI_DEFAULT_BRANCH
variables:
DOCKER_RELEASE_REGISTRY: "quay.io/ncigdc"
- when: always
script:
- docker build .
--file ./Dockerfile
${DOCKER_BUILD_OPTS}
--build-arg http_proxy
--build-arg https_proxy
--build-arg BASE_CONTAINER_VERSION
-t ${DOCKER_RELEASE_REGISTRY}/${CI_PROJECT_NAME}:${VERSION}
- docker push ${DOCKER_PUSH_OPTS} ${DOCKER_RELEASE_REGISTRY}/${CI_PROJECT_NAME}:${VERSION}