forked from do-community/hello_hapi
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathJenkinsfile
More file actions
48 lines (44 loc) · 1.36 KB
/
Jenkinsfile
File metadata and controls
48 lines (44 loc) · 1.36 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
#!/usr/bin/env groovy
pipeline {
agent any
stages {
stage('Build') {
steps {
nodejs('nodejs-default') {
echo 'Building...'
sh 'npm install'
}
}
}
stage('Test') {
steps {
nodejs('nodejs-default') {
echo 'Testing...'
sh 'npm test'
}
}
}
}
post {
always {
echo 'This will always run'
}
success {
echo 'This will run only if successful'
}
failure {
mail to: "[email protected]",
from: '[email protected]',
subject: "ERROR CI: Project name -> ${env.JOB_NAME}",
body: "<b>Example</b><br>\n\n<br>Project: ${env.JOB_NAME} <br>Build Number: ${env.BUILD_NUMBER} <br> URL de build: ${env.BUILD_URL}",
cc: '', charset: 'UTF-8', mimeType: 'text/html', replyTo: ''
}
unstable {
echo 'This will run only if the run was marked as unstable'
}
changed {
echo 'This will run only if the state of the Pipeline has changed'
echo 'For example, if the Pipeline was previously failing but is now successful'
}
}
}