-
Notifications
You must be signed in to change notification settings - Fork 24
/
Jenkinsfile
46 lines (45 loc) · 1.5 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
@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') {
sh "tox > 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: "validator-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() }
}
}
}
}