-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathJenkinsfile
30 lines (25 loc) · 910 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
def COLOR_MAP = ['SUCCESS': 'good', 'FAILURE': 'danger', 'UNSTABLE': 'danger', 'ABORTED': 'danger']
pipeline {
agent any
options {
timeout(time: 5, unit: 'MINUTES' )
}
stages {
stage('Deliver to Production') {
when {
branch 'master'
}
steps {
sh 'rsync -avz /var/lib/jenkins/workspace/memod-resizer_master/ kanvas-image:/home/ubuntu/kanvas-image-resizer/'
sh 'ssh -tt kanvas-image sudo docker-compose -f kanvas-image-resizer/docker-compose.yml up -d --build'
}
}
}
post {
always {
slackSend channel: '#jenkins',
color: COLOR_MAP[currentBuild.currentResult],
message: "*${currentBuild.currentResult}:* Job ${env.JOB_NAME} build ${env.BUILD_NUMBER}\n More info at: ${env.BUILD_URL}"
}
}
}