-
Notifications
You must be signed in to change notification settings - Fork 0
/
Jenkinsfile
109 lines (109 loc) · 4.73 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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
pipeline {
agent any
environment {
UNIT_CODE="SIT753 - Professional Practice in IT"
UNIT_EXERCISE="Week6 Exercise: Jenkins with GitHub"
}
stages {
stage('Build') {
steps {
echo "$UNIT_CODE"
echo "Installing build tools such as Gradle."
echo "SIT753 Unit Exercise: Finished Build stage"
}
}
stage('Test') {
steps {
echo "SIT753 Unit Exercise: Unit tests"
echo "Peforming unit test using tools such as Junit."
echo "SIT753 Unit Exercise: Intergration tests"
echo "Performing integration test using tools such as Jvnet."
echo "SIT753 Unit Exercise: Finished Test stage"
}
post {
always {
echo "$UNIT_EXERCISE"
echo "SIT753 Unit Exercise: Test stage"
}
success {
mail (to: "[email protected]",
subject: "SIT753 UnitExercise Week6 - Jenkins with GitHub - Test stage",
body: "SIT753 Unit Exercise: Stages completed. \nLog file attachments.")
}
failure {
mail (to: "[email protected]",
subject: "SIT753 UnitExercise Week6 - Jenkins with GitHub - Test stage",
body: "SIT753 Unit Exercise: Review stages. \nLog file attachments.")
}
}
}
stage('Code Analysis') {
steps {
echo "SIT753 Unit Exercise: Code analysis tool"
echo "Applying code analysis tools such as CheckStyle."
echo "SIT753 Unit Exercise: Finished Code Analysis stage"
}
}
stage('Security Scan') {
steps {
echo "SIT753 Unit Exercise: Scanning tool"
echo "Applying security scanning with probely-security-plugin."
echo "SIT753 Unit Exercise: Finished Security Scan stage"
}
post {
always {
echo "$UNIT_EXERCISE"
echo "SIT753 Unit Exercise: Security Scan stage"
}
success {
mail (to: "[email protected]",
subject: "SIT753 UnitExercise Week6 - Jenkins with GitHub - Security Scan stage",
body: "SIT753 Unit Exercise: Stages completed. \nLog file attachments.")
}
failure {
mail (to: "[email protected]",
subject: "SIT753 UnitExercise Week6 - Jenkins with GitHub - Security Scan stage",
body: "SIT753 Unit Exercise: Review stages. \nLog file attachments.")
}
}
}
stage('Deploy to Staging') {
steps {
echo "SIT753 Unit Exercise: Staging environment"
echo "The application is completed deployed to staging server such as AWS EMR."
echo "SIT753 Unit Exercise: Finished Staging stage"
}
}
stage('Test on Staging') {
steps {
echo "SIT753 Unit Exercise: Integration Tests"
echo "Performing integration test using tools such as Jvnet."
echo "SIT753 Unit Exercise: Finished Test on Staging stage"
}
post {
always {
echo "$UNIT_EXERCISE"
echo "SIT753 Unit Exercise: Test on Staging stage"
}
success {
mail (to: "[email protected]",
subject: "SIT753 UnitExercise Week6 - Jenkins with GitHub - Test on Staging stage",
body: "SIT753 Unit Exercise: Stages completed. \nLog file attachments.")
}
failure {
mail (to: "[email protected]",
subject: "SIT753 UnitExercise Week6 - Jenkins with GitHub - Test on Staging stage",
body: "SIT753 Unit Exercise: Review stages. \nLog file attachments.")
}
}
}
stage('Deploy to Production') {
steps {
echo "SIT753 Unit Exercise: Production environment"
echo "SIT753 Unit Exercise: Improvements on Video Demonstration"
echo "The application is completed deployed to production server such as AWS EMR"
echo "SIT753 Unit Exercise: Finished Deploy to Production stage"
}
}
}
}