-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathJenkinsfile
34 lines (33 loc) · 992 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
def slackMessages = []
pipeline {
agent { label "master" }
stages {
stage("Build container") {
agent { label "docker" }
steps {
script {
sh "docker build -t localhost:5000/reevefresh:latest ."
slackMessages += "New container image localhost:5000/reevefresh:latest"
}
}
}
stage("Deploy container") {
agent { label "docker" }
steps {
script {
sh "docker save localhost:5000/reevefresh:latest | bzip2 | ssh oracle 'bunzip2 | docker load'"
slackMessages += "Container deployed to Oracle virtual machine"
}
}
}
}
post {
success { cleanWs() }
always {
sendSlackNotifications (
buildStatus: currentBuild.result,
threadMessages: slackMessages
)
}
}
}