-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitlab-ci.yml
45 lines (40 loc) · 1.03 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
image: python:3.6-jessie
before_script:
- pip install pip --upgrade
variables:
PYPI_REPOSITORY: SECURE
PYPI_USERNAME: SECURE
PYPI_PASSWORD: SECURE
stages:
- test
- deploy
# put your tests here
image: python:3.6-jessie
test36:
stage: test
script:
- pip install pytest pytest-cov
- pip install -r requirements.txt
- pip install .
- cd tests
- pytest --cov reportipy
only:
- merge_requests
deploy_pypi:
stage: deploy
script:
- pip install twine setuptools wheel
- python3 setup.py bdist_wheel #build the package
- pip install .
- echo "[distutils]" >> ~/.pypirc # create credential file
- echo "index-servers =" >> ~/.pypirc
- echo " aabd" >> ~/.pypirc
- echo "" >> ~/.pypirc
- echo "[aabd]" >> ~/.pypirc
- echo "repository:" $PYPI_REPOSITORY >> ~/.pypirc
- echo "username:" $PYPI_USERNAME >> ~/.pypirc
- echo "password:" "$PYPI_PASSWORD" >> ~/.pypirc
- twine upload --repository aabd dist/* # upload to server
- echo "" > ~/.pypirc && rm ~/.pypirc
only:
- master