forked from jenkins-infra/plugin-site
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathJenkinsfile
81 lines (74 loc) · 1.62 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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
pipeline {
environment {
GET_CONTENT = "true"
NODE_ENV = "production"
HOME = "/tmp"
TZ = "UTC"
}
agent {
label 'docker&&linux'
}
options {
timeout(time: 60, unit: 'MINUTES')
ansiColor('xterm')
disableConcurrentBuilds(abortPrevious: true)
buildDiscarder logRotator(artifactDaysToKeepStr: '', artifactNumToKeepStr: '', daysToKeepStr: '5', numToKeepStr: '5')
}
stages {
stage('Check for typos') {
steps {
sh 'typos --format json | typos-checkstyle - > checkstyle.xml || true'
recordIssues(tools: [checkStyle(id: 'typos', name: 'Typos', pattern: 'checkstyle.xml')], qualityGates: [[threshold: 1, type: 'TOTAL', unstable: true]])
}
}
stage('NPM Install') {
agent {
docker {
image 'node:18.15.0'
reuseNode true
}
}
steps {
sh('yarn install')
}
}
stage('Build Production') {
agent {
docker {
image 'node:18.15.0'
reuseNode true
}
}
steps {
sh('yarn build')
}
}
stage('Check build') {
agent {
docker {
image 'node:18.15.0'
reuseNode true
}
}
steps {
sh 'test -e ./plugins/plugin-site/public/index.html || exit 1'
}
}
stage('Lint and Test') {
environment {
NODE_ENV = "development"
NODE_OPTIONS="--experimental-vm-modules"
}
agent {
docker {
image 'node:18.15.0'
reuseNode true
}
}
steps {
sh('yarn lint')
sh('yarn test')
}
}
}
}