-
Notifications
You must be signed in to change notification settings - Fork 49
/
Copy pathJenkinsfile
34 lines (34 loc) · 969 Bytes
/
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
pipeline {
agent any
stages {
stage('Verify') {
steps {
sh '''
docker version
docker-compose version
'''
}
}
stage('Build') {
steps {
sh 'docker-compose build'
}
}
stage('Test') {
steps {
sh 'docker container run pi:bday7 -dp 7'
}
}
stage('Push') {
steps {
withCredentials([usernamePassword(credentialsId: 'dockerHub', usernameVariable: 'HUB_USER', passwordVariable: 'HUB_TOKEN')]) {
sh '''
docker login -u $HUB_USER -p $HUB_TOKEN
docker image tag pi:bday7 $HUB_USER/pi:bday7
docker image push $HUB_USER/pi:bday7
'''
}
}
}
}
}