-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathJenkinsfile
More file actions
48 lines (44 loc) · 1.45 KB
/
Jenkinsfile
File metadata and controls
48 lines (44 loc) · 1.45 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
pipeline {
agent any
environment {
RECIPIENT_EMAIL = 'kelvinoh.fusheng.1@gmail.com'
}
stages {
stage('Build') {
steps {
echo 'Tool: npm (Node Package Manager)'
}
}
stage('Test') {
steps {
echo 'Tool: Jest (or Mocha, depending on your setup)'
}
post {
always {
emailext (
subject: "Jenkins Test Stage: ${currentBuild.currentResult}",
body: "The test stage has completed with status: ${currentBuild.currentResult}",
to: "${env.RECIPIENT_EMAIL}",
attachmentsPattern: 'test-log.txt'
)
}
}
}
stage('Security Scan') {
steps {
bat 'npm audit > audit-log.txt || exit /b 0'
echo 'Tool: npm audit (built-in Node.js security scanner)'
}
post {
always {
emailext (
subject: "Jenkins Security Scan: ${currentBuild.currentResult}",
body: "The security scan has completed with status: ${currentBuild.currentResult}",
to: "${env.RECIPIENT_EMAIL}",
attachmentsPattern: 'audit-log.txt'
)
}
}
}
}
}