forked from LFD254/example-voting-app
-
Notifications
You must be signed in to change notification settings - Fork 94
/
Jenkinsfile
61 lines (53 loc) · 1.26 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
51
52
53
54
55
56
57
58
59
60
61
pipeline {
agent none
stages{
stage('Build'){
agent{
docker{
image 'python:2.7.16-slim'
args '--user root'
}
}
steps{
echo 'Compiling vote app'
dir('vote'){
sh 'pip install -r requirements.txt'
}
}
}
stage('Unit Test'){
agent{
docker{
image 'python:2.7.16-slim'
args '--user root'
}
}
steps{
echo 'Running Unit Tests on vote app'
dir('vote'){
sh 'pip install -r requirements.txt'
sh 'nosetests -v'
}
}
}
stage('Docker BnP'){
agent any
steps{
echo 'Packaging vote app with docker'
script{
docker.withRegistry('https://index.docker.io/v1/', 'dockerlogin') {
def voteImage = docker.build("xxxxxx/vote:v${env.BUILD_ID}", "./vote")
voteImage.push()
voteImage.push("dev")
voteImage.push("latest")
}
}
}
}
}
post{
always{
echo 'Pipeline for vote is complete..'
}
}
}