-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathjenkins
76 lines (68 loc) · 2.41 KB
/
jenkins
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
pipeline {
agent any
stages {
stage('Build') {
steps {
echo "Building using build automation tool Maven ..."
}
}
stage('Unit and Integration Tests') {
steps {
echo "Testing unit using JUnit for Maven and testing integration using TestNG for Maven ..."
}
post {
success {
emailext to: 'andrewpaull82@gmail.com',
subject: 'Unit and Integration Tests - Success',
body: 'The tests have passed successfully.',
attachLog: true
}
failure {
emailext to: 'andrewpaull82@gmail.com',
subject: 'Unit and Integration Tests - Failure',
body: 'The tests have failed. Please check the attached logs.',
attachLog: true
}
}
}
stage('Code Analysis') {
steps {
echo "Analysing code to ensure it meets industry standards with SonarScanner for Maven ..."
}
}
stage('Security Scan') {
steps {
echo "Security scanning with OWASP ZAP ..."
}
post {
success {
emailext to: 'andrewpaull82@gmail.com',
subject: 'Security Scan - Success',
body: 'The security scan has completed successfully.',
attachLog: true
}
failure {
emailext to: 'andrewpaull82@gmail.com',
subject: 'Security Scan - Failure',
body: 'The security scan has failed. Please check the attached logs.',
attachLog: true
}
}
}
stage('Deploy to Staging') {
steps {
echo "Deploying application to an AWS EC2 server..."
}
}
stage('Integration Tests on Staging') {
steps {
echo "Running integration tests on the staging environment to ensure the app. functions as expected in a production-like environment ..."
}
}
stage('Deploy to Production') {
steps {
echo "Deploying app. to production server AWS EC2 ..."
}
}
}
}