-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathJenkinsfile
64 lines (64 loc) · 2.2 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
pipeline {
agent any
tools {
nodejs 'node23'
}
stages {
stage('Install Dependencies') {
steps {
script {
echo "--------------------------------------------------"
echo "--------------------------------------------------"
echo "Git URL: ${env.GIT_URL}"
echo "Branch: ${env.GIT_BRANCH}"
echo "Commit: ${env.GIT_COMMIT}"
echo "Previous Commit: ${env.GIT_PREVIOUS_COMMIT}"
echo "Build Number: ${env.BUILD_NUMBER}"
echo "Build ID: ${env.BUILD_ID}"
echo "Build URL: ${env.BUILD_URL}"
echo "Workspace: ${env.JOB_URL}"
echo "Node: ${env.NODE_NAME}"
echo "EXECUTOR_NUMBER: ${env.EXECUTOR_NUMBER}"
echo "--------------------------------------------------"
echo "--------------------------------------------------"
echo "Installing Dependencies..."
sh 'npm install --loglevel verbose'
}
}
}
stage('Test') {
steps {
script {
sh 'echo "Testing..."'
sh 'npm test'
}
}
}
stage('Publish Coverage') {
steps {
script {
sh 'echo "Publishing Coverage..."'
// Check for the existence of the coverage report
sh 'ls -l coverage/cobertura-coverage.xml'
}
recordCoverage(tools: [[parser: 'COBERTURA', pattern: 'coverage/cobertura-coverage.xml']], sourceCodeRetention: 'EVERY_BUILD')
}
}
stage('Build') {
steps {
script {
sh 'echo "Building..."'
sh 'npm run build'
}
}
}
stage('Notify') {
steps {
script {
sh 'echo "Notifying..."'
sh "${env.JOB_NAME} succeeded"
}
}
}
}
}