-
Notifications
You must be signed in to change notification settings - Fork 6
/
Jenkinsfile
50 lines (37 loc) · 1.22 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
#!/usr/bin/env groovy
import hudson.model.*
import hudson.EnvVars
node {
try {
def img_tag = "flaskddbtest"
// load shared jenkins code
@Library('shared-pipelines')_
stage("Stage Repo") {
echo "Checkout repo"
checkout scm
}
stage("Build test image") {
sh "docker build -f Dockerfile.jenkins -t ${img_tag} ."
}
stage("Run Tests") {
sh "docker run --rm -v ${env.WORKSPACE}:${env.WORKSPACE} -w ${env.WORKSPACE} -v /etc/passwd:/etc/passwd:ro -ujhardy ${img_tag} python3 setup.py covxml"
sh "chmod -R 777 ${env.WORKSPACE}"
currentBuild.result = "SUCCESS"
}
stage("Send Code Coverage") {
if (currentBuild.result == "SUCCESS") {
codecovio("FlaskDynamoSessionCodeCov")
} else {
echo "Skipping coverage report..."
}
}
if (env.TAG_NAME && currentBuild.result == "SUCCESS") {
stage("Publish To PyPi") {
pypi(env.WORKSPACE, "flask-dynamodb-sessions", img_tag)
}
}
} catch(Exception err) {
currentBuild.result = "FAILURE"
} finally {
}
}