-
Notifications
You must be signed in to change notification settings - Fork 1
/
checkbox.yml
51 lines (51 loc) · 1.47 KB
/
checkbox.yml
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
---
- job:
name: checkbox.io
project-type: pipeline
defaults: global
description: "Builds checkbox.io program and runs npm test."
disabled: false
display-name: "checkbox.io Pipeline Build"
concurrent: false
retry-count: 3
dsl: |
node {
stage("Removing checkbox.io...") {
dir('/tmp/jenkins') {
sh 'rm -rf checkbox.io'
}
}
stage("Cloning checkbox.io...") {
dir('/tmp/jenkins') {
sh 'git clone https://github.com/chrisparnin/checkbox.io.git'
}
}
stage("Installing dependencies...") {
dir('/tmp/jenkins/checkbox.io/server-side/site') {
sh 'npm install'
}
}
stage("Starting checkbox.io server...") {
dir('/tmp/jenkins/checkbox.io/server-side/site') {
sh "pm2 start server.js"
}
}
stage("Running static analysis...") {
dir('/tmp/jenkins/checkbox.io/server-side/site') {
sh "node /bakerx/analysis.js ../site"
}
catchError(buildResult: 'FAILURE', stageResult: 'FAILURE') {
sh 'exit 1'
}
}
stage("Running tests...") {
dir('/tmp/jenkins/checkbox.io/server-side/site') {
sh "npm test"
}
}
stage("Stopping server...") {
dir('/tmp/jenkins/checkbox.io/server-side/site') {
sh "pm2 stop server.js"
}
}
}