forked from jenkinsci/pipeline-examples
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathJenkinsfile
77 lines (69 loc) · 1.48 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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
pipeline {
agent any
//options {
// using the Timestamper plugin we can add timestamps to the console log
//timestamps() <--- BUG: https://issues.jenkins-ci.org/browse/JENKINS-48556
//}
environment {
env = 'qa'
}
stages {
stage('Build') {
steps {
echo '\u001B[31mBuilding...'
build 'QA/qa.build.app'
}
}
stage('Test') {
steps {
echo 'Testing..'
build 'QA/qa.test.app'
}
}
stage('Deploy') {
when {
// skip this stage unless on Master branch
branch "master"
}
steps {
echo 'Deploying....'
build 'QA/qa.deploy.app'
}
/*
post {
aborted {
echo "Stage 'Deploy' WAS ABORTED"
}
always {
echo "Stage 'Deploy' finished"
}
changed {
echo "Stage 'Deploy' HAVE CHANGED"
}
failure {
echo "Stage 'Deploy' FAILED"
}
success {
echo "Stage 'Deploy' was Successful"
}
unstable {
echo "Stage 'Deploy' is Unstable"
}
}
*/
}
stage('Doc') {
steps {
echo 'Generate Doc...'
}
}
}
post {
failure {
// notify users when the Pipeline fails
mail to: '[email protected]',
subject: "Failed Pipeline: ${currentBuild.fullDisplayName}",
body: "Something is wrong with ${env.BUILD_URL}"
}
}
}