-
Notifications
You must be signed in to change notification settings - Fork 3
/
.gitlab-ci.yml
54 lines (47 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
image: python:3.7
stages:
- lint
- test
- deploy
- test_pypi
before_script:
- pip install --upgrade pip
- pip install poetry
- poetry config virtualenvs.create false
- poetry install
Python Code Lint:
stage: lint
script:
- ./tests/run_syntax.sh
Unit Tests:
stage: test
script:
- poetry run behave tests/features/
MkDocs Deployment:
stage: deploy
only: [master, develop]
before_script:
- apt-get update -qq
- apt-get install -qq git
- 'which ssh-agent || ( apt-get install -qq openssh-client )'
- eval $(ssh-agent -s)
- ssh-add <(echo "$SSH_PRIVATE_KEY")
- mkdir -p ~/.ssh
- '[[ -f /.dockerenv ]] && echo -e "Host *\n\tStrictHostKeyChecking no\n\n" > ~/.ssh/config'
script:
- ssh -p 22 -A root@netests.io "cd /srv/netests &&
git pull https://oauth2:$ACCES_TOKEN_DH@gitlab.com/DylanHamel/netests.git &&
mkdocs build &&
service nginx restart"
Netests PyPi Deployement:
stage: deploy
only: [master, develop]
script:
- poetry build
- poetry publish --username $PYPI_POETRY_USERNAME --password $PYPI_POETRY_PASSWORD
Install and Test Netests:
stage: test_pypi
only: [master, develop]
script:
- pip install --no-cache-dir netests
- netests --show-data-model bgp