-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathJenkinsfile-node-v7
58 lines (55 loc) · 1.06 KB
/
Jenkinsfile-node-v7
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
#!/usr/bin/env groovy
def cleanup_workspace() {
cleanWs()
dir("${env.WORKSPACE}@tmp") {
deleteDir()
}
dir("${env.WORKSPACE}@script") {
deleteDir()
}
dir("${env.WORKSPACE}@script@tmp") {
deleteDir()
}
}
pipeline {
agent any
tools {
nodejs "node-v7"
}
environment {
NPM_RC_FILE = 'process-engine-ci-token'
NODE_JS_VERSION = 'node-v7'
}
stages {
stage('prepare') {
steps {
nodejs(configId: env.NPM_RC_FILE, nodeJSInstallationName: env.NODE_JS_VERSION) {
sh 'node --version'
sh 'npm install --ignore-scripts'
}
}
}
stage('build') {
steps {
sh 'node --version'
sh 'npm run build'
}
}
stage('cleanup') {
steps {
script {
// this stage just exists, so the cleanup-work that happens in the post-script
// will show up in its own stage in Blue Ocean
sh(script: ':', returnStdout: true);
}
}
}
}
post {
always {
script {
cleanup_workspace();
}
}
}
}