-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathJenkinsfile
More file actions
48 lines (41 loc) · 992 Bytes
/
Jenkinsfile
File metadata and controls
48 lines (41 loc) · 992 Bytes
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 {
NODE_ENV = "development"
}
stages {
stage('Setup') {
steps {
script {
sh 'npm i yarn -g'
sh 'yarn'
}
}
}
stage('Test') {
steps {
script {
withEnv(['NODE_ENV=test']) {
sh 'mkdir -p reports'
sh 'yarn test'
junit 'reports/*.xml'
}
}
}
}
post {
always {
sh 'npm prune'
sh 'rm -rf node_modules'
}
success {
slackSend color: 'good', message: "Success: Job '${env.JOB_NAME} [${env.BUILD_NUMBER}]' (${env.BUILD_URL}) succeeded"
}
unstable {
slackSend color: 'warning', message: "Unstable: Job '${env.JOB_NAME} [${env.BUILD_NUMBER}]' (${env.BUILD_URL}) is unstable"
}
failure {
slackSend color: 'danger', message: "Failure: Job '${env.JOB_NAME} [${env.BUILD_NUMBER}]' (${env.BUILD_URL}) failed"
}
}
}