0001-create-jenkins-pipeline-job-23431.patch
.gitignore | ||
---|---|---|
13 | 13 |
.cache |
14 | 14 |
.coverage |
15 | 15 |
.pytest_cache/ |
16 |
.tox |
Jenkinsfile | ||
---|---|---|
1 |
@Library('eo-jenkins-lib@v0.2') import eo.Utils |
|
2 | ||
3 |
pipeline { |
|
4 |
agent any |
|
5 |
stages{ |
|
6 |
stage('unit test'){ |
|
7 |
steps{ |
|
8 |
sh 'tox -rv' |
|
9 |
} |
|
10 |
} |
|
11 |
stage('packaging'){ |
|
12 |
steps{ |
|
13 |
script { |
|
14 |
if (env.BRANCH_NAME == 'master') { |
|
15 |
sh 'sudo -H -u eobuilder /usr/local/bin/eobuilder -d jessie,stretch combo' |
|
16 |
} |
|
17 |
} |
|
18 |
} |
|
19 |
} |
|
20 |
} |
|
21 |
post { |
|
22 |
always { |
|
23 |
junit '*_results.xml' |
|
24 |
script { |
|
25 |
utils = new Utils() |
|
26 |
utils.publish_coverage('coverage.xml') |
|
27 |
utils.publish_pylint('pylint.out') |
|
28 |
utils.mail_notify(currentBuild, env, 'admin+jenkins-combo@entrouvert.com') |
|
29 |
} |
|
30 |
cleanWs() |
|
31 |
} |
|
32 |
} |
|
33 |
} |
get_wcs.sh | ||
---|---|---|
1 |
#!/bin/sh -xue |
|
2 | ||
3 |
test -d wcs || git clone http://git.entrouvert.org/wcs.git |
|
4 |
(cd wcs && git pull) |
jenkins.sh | ||
---|---|---|
1 |
#!/bin/sh |
|
2 | ||
3 |
set -e |
|
4 | ||
5 |
rm -f pylint.out |
|
6 |
rm -f coverage.xml |
|
7 |
rm -f test_results.xml |
|
8 | ||
9 |
test -d wcs || git clone http://git.entrouvert.org/wcs.git |
|
10 |
(cd wcs && git pull) |
|
11 | ||
12 |
pip install --upgrade tox |
|
13 |
tox -rv |
pylint.sh | ||
---|---|---|
11 | 11 |
exit 0 |
12 | 12 |
fi |
13 | 13 | |
14 |
test -f pylint.out && cp pylint.out pylint.out.prev |
|
15 | 14 |
pylint -f parseable --rcfile ${PYLINT_RC} "$@" | tee pylint.out || /bin/true |
16 |
test -f pylint.out.prev && (diff pylint.out.prev pylint.out | grep '^[><]' | grep .py) || /bin/true |
tox.ini | ||
---|---|---|
1 | 1 |
[tox] |
2 |
envlist = coverage-{django18,django111}-pylint |
|
3 |
toxworkdir = {env:TMPDIR:/tmp}/tox-{env:USER}/combo/ |
|
2 |
envlist = dj{18,111} |
|
4 | 3 | |
5 | 4 |
[testenv] |
6 | 5 |
usedevelop = True |
... | ... | |
8 | 7 |
WCSCTL=wcs/wcsctl.py |
9 | 8 |
DJANGO_SETTINGS_MODULE=combo.settings |
10 | 9 |
COMBO_SETTINGS_FILE=tests/settings.py |
11 |
coverage: COVERAGE=--junitxml=test_results.xml --cov-report xml --cov=combo/ |
|
12 | 10 |
deps = |
13 |
django18: django>=1.8,<1.9
|
|
14 |
django111: django>=1.11,<1.12
|
|
11 |
dj18: django>=1.8,<1.9 |
|
12 |
dj111: django>=1.11,<1.12 |
|
15 | 13 |
pytest-cov |
16 | 14 |
pytest-django |
17 | 15 |
pytest |
18 | 16 |
WebTest |
19 | 17 |
mock |
20 | 18 |
httmock |
19 |
psycopg2 |
|
21 | 20 |
pylint<1.8 |
22 | 21 |
pylint-django<0.9 |
23 | 22 |
django-webtest |
24 | 23 |
quixote<3.0 |
25 | 24 |
vobject |
26 | 25 |
commands = |
27 |
py.test {env:COVERAGE:} {posargs:tests/} |
|
28 |
pylint: ./pylint.sh combo/ |
|
26 |
./get_wcs.sh |
|
27 |
dj18: py.test {posargs: --junitxml=test_{envname}_results.xml --cov-report xml --cov=combo/ tests/} |
|
28 |
dj18: ./pylint.sh combo/ |
|
29 |
dj111: py.test {posargs: --junitxml=test_{envname}_results.xml tests/} |
|
29 |
- |