-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathjenkinsfile
More file actions
69 lines (62 loc) · 1.44 KB
/
Copy pathjenkinsfile
File metadata and controls
69 lines (62 loc) · 1.44 KB
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
pipeline {
agent any
stages {
stage('Checkout') {
steps {
git branch: 'main', url: 'https://github.com/SidharthSabu/8.2CDevSecOps.git'
}
}
stage('Install Dependencies') {
steps {
sh 'npm install'
}
}
stage('Run Tests') {
steps {
sh 'npm test || true'
}
post {
always {
emailext (
subject: "Test Stage Complete - ${env.JOB_NAME} #${env.BUILD_NUMBER}",
body: """
Test Stage Status: ${currentBuild.currentResult}
Project: ${env.JOB_NAME}
Build Number: ${env.BUILD_NUMBER}
Build URL: ${env.BUILD_URL}
Console log is attached.
""",
to: 'sidharthsabu2020@gmail.com',
attachLog: true
)
}
}
}
stage('Generate Coverage Report') {
steps {
sh 'npm run coverage || true'
}
}
stage('NPM Audit (Security Scan)') {
steps {
sh 'npm audit || true'
}
post {
always {
emailext (
subject: "Security Scan Complete - ${env.JOB_NAME} #${env.BUILD_NUMBER}",
body: """
Security Scan Status: ${currentBuild.currentResult}
Project: ${env.JOB_NAME}
Build Number: ${env.BUILD_NUMBER}
Build URL: ${env.BUILD_URL}
Security scan results and console log are attached.
""",
to: 'sidharthsabu2020@gmail.com',
attachLog: true
)
}
}
}
}
}