-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathJenkinsfile
40 lines (35 loc) · 904 Bytes
/
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
pipeline {
agent any
environment {
NODE_HOME = tool name: 'NodeJS', type: 'NodeJSInstallation'
PATH = "${NODE_HOME}/bin:${env.PATH}"
}
stages {
stage('Checkout') {
steps {
git branch: 'main', url: 'https://github.com/theofurtado05/API-ValidadorCPF.git'
}
}
stage('Install Dependencies') {
steps {
sh 'npm install'
}
}
stage('Run Tests') {
steps {
sh 'npm test'
}
}
}
post {
always {
junit 'reports/junit/results.xml'
archiveArtifacts artifacts: 'reports/junit/results.xml', allowEmptyArchive: true
}
failure {
script {
echo "Pipeline failed. Check the Jenkins job: ${env.BUILD_URL}"
}
}
}
}