forked from Rosalita/GoViolin
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathjenkinsfile
43 lines (34 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
pipeline {
agent { label 'slave' }
stages {
stage('Build') {
steps {
sh 'docker build -f Dockerfile . -t yehiam90/go_web_abb:v1.0'
}
}
stage('Push') {
steps {
withCredentials([usernamePassword(credentialsId:"docker",usernameVariable:"USERNAME",passwordVariable:"PASSWORD")]){
sh 'docker login --username $USERNAME --password $PASSWORD'
sh 'docker push yehiam90/go_web_abb:v1.0'
}
}
}
stage('Deploy') {
steps {
sh 'docker run -d -p 5050:6060 yehiam90/go_web_abb:v1.0'
}
}
}
post {
success {
slackSend (color: '#00FF00', message: "SUCCESSFUL: Job '${env.JOB_NAME} [${env.BUILD_NUMBER}]' (${env.BUILD_URL}console)")
}
failure {
slackSend (color: '#FF0000', message: "FAILED: Job '${env.JOB_NAME} [${env.BUILD_NUMBER}]' (${env.BUILD_URL}console)")
}
aborted {
slackSend (color: '#000000', message: "ABORTED: Job '${env.JOB_NAME} [${env.BUILD_NUMBER}]' (${env.BUILD_URL}console)")
}
}
}