forked from openshift-eng/doozer
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Jenkinsfile
50 lines (49 loc) · 1.86 KB
/
Jenkinsfile
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
@Library('art-ci-toolkit@master') _
pipeline {
agent {
docker {
image "openshift-art/art-ci-toolkit:latest"
alwaysPull true
args "-e http_proxy -e https_proxy -e no_proxy -e HTTP_PROXY -e HTTPS_PROXY -e NO_PROXY --entrypoint=''"
}
}
stages {
stage("Tests & Coverage") {
steps {
script {
catchError(stageResult: 'FAILURE') {
// Rebuild tox environment after change requirements. https://github.com/openshift/elliott/pull/149
sh """
tox_args="\$(git diff --name-only HEAD~5 | grep -Fxq -e requirements.txt -e requirements-dev.txt -e MANIFEST.in -e setup.py && echo '--recreate' || true)"
tox \$tox_args > results.txt 2>&1
"""
}
results = readFile("results.txt").trim()
echo results
if (env.CHANGE_ID) {
commentOnPullRequest(msg: "### Build <span>#</span>${env.BUILD_NUMBER}\n```\n${results}\n```")
}
}
}
}
stage("Publish Coverage Report") {
steps {
catchError(buildResult: 'UNSTABLE', stageResult: 'FAILURE') {
withCredentials([string(credentialsId: "doozer-codecov-token", variable: "CODECOV_TOKEN")]) {
sh "codecov --token ${env.CODECOV_TOKEN}"
}
}
}
}
stage("Publish to PyPI") {
when {
buildingTag()
}
steps {
sh "python3 setup.py bdist_wheel --universal"
sh "python3 -m twine check dist/*"
script { publishToPyPI() }
}
}
}
}