-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitlab-ci.yml
52 lines (50 loc) · 1.83 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
stages:
- test
unit_tests_linux:
allow_failure: false
image: nexus.synerty.com:5000/peek-linux-test
only:
- pushes
- web
- triggers
- merge_requests
script:
- export PIP_INDEX=http://${NEXUS_USER}:${NEXUS_PASSWORD}@${NEXUS_URL}/repository/pypi-all/pypi
- export PIP_INDEX_URL=http://${NEXUS_USER}:${NEXUS_PASSWORD}@${NEXUS_URL}/repository/pypi-all/simple
- export PIP_TRUSTED_HOST=${NEXUS_URL}
- pip install -e .
- trial --reporter=subunit `find peek_* -name "*Test.py"` | subunit-1to2 | subunit2junitxml -o report.xml 1> /dev/null
- echo "Tests have succeeded, this package will be uploaded to nexus as 0.0.0"
- echo "This will only happen in the peek group project and master branch"
- rm -rf dist
- sed -i "s/0.0.0/0.0.0+b${CI_PIPELINE_ID}/g" setup.py
- export TWINE_REPOSITORY_URL=http://${NEXUS_URL}/repository/pypi-internal/
- export TWINE_USERNAME=${NEXUS_USER}
- export TWINE_PASSWORD=${NEXUS_PASSWORD}
- if [[ ${CI_PROJECT_NAMESPACE} == peek/* ]] && [[ ${CI_COMMIT_REF_NAME} == 'master' ]];
then
wget https://gitlab.synerty.com/peek/community/synerty-peek/-/raw/master/gitlab/scripts/rm-from-nexux.py
&& python setup.py sdist
&& python rm-from-nexux.py "http://${NEXUS_URL}" "${NEXUS_USER}" "${NEXUS_PASSWORD}" "${CI_PROJECT_NAME}"
&& twine upload dist/*.gz;
fi
stage: test
artifacts:
reports:
junit: report.xml
tags:
- linux
sonar:
allow_failure: false
image: nexus.synerty.com:5000/peek-linux-sonar
only:
- pushes
- web
- triggers
- merge_requests
stage: test
script:
- echo "Run sonar-scanner"
- sonar-scanner
tags:
- linux