-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathJenkinsfile
47 lines (43 loc) · 1.72 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
node('v2-slave'){
step([$class: 'WsCleanup'])
try
{
dir('node_modules'){
deleteDir()
}
dir('dist'){
deleteDir()
}
git branch: env.BRANCH_NAME, credentialsId: 'stoicbot-github-ssh', url: "[email protected]:sutoiku/lambda-artifacts-cleaner"
stage name: 'Resolving dependencies', concurrency: 1
sh("npm i")
stage name: 'Unit testing', concurrency: 1
try{
sh("npm run stoic-unit-tests")
}
catch(err){
throw err
}
finally{
step([$class: "JUnitResultArchiver", testResults: "reports/report.xml"])
step([$class: 'CoberturaPublisher',
autoUpdateHealth: false,
autoUpdateStability: false,
coberturaReportFile: 'coverage/cobertura-coverage.xml',
failUnhealthy: false,
failUnstable: false,
maxNumberOfBuilds: 0,
onlyStable: false,
sourceEncoding: 'ASCII',
zoomCoverageChart: false
])
}
stage name: 'Deploying', concurrency: 1
sh("node node_modules/grunt-cli/bin/grunt deploy")
slackSend channel: '#builds', color: 'success', message: "Build Done : ${env.JOB_NAME}\nBranch : ${env.BRANCH_NAME} (<${env.BUILD_URL}|Open>)"
}
catch (error){
slackSend channel: '#builds', color: 'danger', message: "Build failed : ${env.JOB_NAME}\nBranch : ${env.BRANCH_NAME} (<${env.BUILD_URL}|Open>)"
throw error
}
}