-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.gitlab-ci.yml
58 lines (52 loc) · 1.33 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
variables:
PIP_CACHE_DIR: $CI_PROJECT_DIR/.cache/pip
DOCKER_DRIVER: overlay2
cache:
paths:
- .cache/pip
key: "$CI_PROJECT_ID"
dockerbuild:
stage: build
before_script:
- docker login $CI_REGISTRY --username $CI_REGISTRY_USER --password $CI_REGISTRY_PASSWORD
script:
- docker build --rm --cache-from $CI_REGISTRY_IMAGE:latest --build-arg PIP_INDEX_URL=$PIP_INDEX_URL --tag $CI_REGISTRY_IMAGE:$CI_COMMIT_SHORT_SHA --tag $CI_REGISTRY_IMAGE:latest .
- docker push $CI_REGISTRY_IMAGE:$CI_COMMIT_SHORT_SHA
- docker push $CI_REGISTRY_IMAGE:latest
needs: []
tags:
- pdbe-shell
runtests:
stage: test
image: $CI_REGISTRY_IMAGE:$CI_COMMIT_SHORT_SHA
script:
- pip install pytest
- pip install -e .
- pytest
artifacts:
reports:
cobertura: coverage/cobertura-coverage.xml
junit: report.xml
needs: [dockerbuild]
tags:
- pdbe-docker
include:
- template: Code-Quality.gitlab-ci.yml
code_quality:
services: # Nothing here
tags:
- pdbe-shell
wheel:
stage: deploy
script:
- pip install twine
- python setup.py sdist bdist_wheel
- TWINE_PASSWORD=${CI_JOB_TOKEN} TWINE_USERNAME=gitlab-ci-token python -m twine upload --repository-url ${PIP_INDEX_URL%/simple} dist/*
artifacts:
paths:
- dist/
only:
refs:
- master
tags:
- pdbe-docker