-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitlab-ci.yml
53 lines (43 loc) · 1.04 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
# Continuous integration \ deployment
stages:
- build
- test
- deploy
variables:
TEST_IMAGE_NAME: "registry.gitlab.com/alexbenfica/check-links:test"
build_test_container:
stage: build
image: docker:latest
services:
- docker:dind
tags:
- docker
script:
- docker login -u gitlab-ci-token -p $CI_JOB_TOKEN registry.gitlab.com
- docker build -t $TEST_IMAGE_NAME .
- docker push $TEST_IMAGE_NAME
run_tests:
stage: test
image: docker:latest
services:
- docker:dind
tags:
- docker
script:
- docker run $TEST_IMAGE_NAME pytest /tests
#- docker run $TEST_IMAGE_NAME pylint --max-line-length=120 /app/*.py
- docker rmi $TEST_IMAGE_NAME --force
publish_to_pypi:
stage: deploy
image: python:3
only:
- master
script:
- apt update
- apt install -y python3-pip
- pip3 install -U wheel
- pip3 install -U setuptools
- pip3 install twine
- rm -rf build dist *.egg-info
- python setup.py sdist bdist_wheel
- twine upload -u alexbenfica -p $PYPI_PASSWORD dist/*