-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathJenkinsfile
45 lines (42 loc) · 1.19 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
pipeline {
agent any
stages {
stage('Build and Deploy') {
steps {
dir('docker'){
sh 'docker-compose up -d --build'
}
echo '启动容器中……'
}
}
// stage('Clean') {
// when {
// expression {
// currentBuild.result == null || currentBuild.result == 'SUCCESS'
// }
// }
// steps {
// sh 'docker system prune -f --volumes'
// echo '打扫垃圾……'
// }
// }
}
post {
always {
echo '部署流程结束'
// deleteDir() /* clean up our workspace */
}
success {
echo '成功!'
}
unstable {
echo 'I am unstable :/'
}
failure {
echo '恭喜你,部署失败'
}
changed {
echo '接下来宣布结果……'
}
}
}