forked from jenkins-infra/plugin-site
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathJenkinsfile
83 lines (76 loc) · 1.86 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
82
83
pipeline {
environment {
GET_CONTENT = "true"
NODE_ENV = "production"
HOME = "/tmp"
TZ = "UTC"
}
agent {
label 'docker&&linux'
}
options {
timeout(time: 60, unit: 'MINUTES')
ansiColor('xterm')
buildDiscarder logRotator(artifactDaysToKeepStr: '', artifactNumToKeepStr: '', daysToKeepStr: '5', numToKeepStr: '5')
}
stages {
stage('Check for typos') {
steps {
sh '''
curl -qsL https://github.com/crate-ci/typos/releases/download/v1.13.9/typos-v1.13.9-x86_64-unknown-linux-musl.tar.gz | tar xvzf - ./typos
curl -qsL https://github.com/halkeye/typos-json-to-checkstyle/releases/download/v0.1.1/typos-checkstyle-v0.1.1-x86_64 > typos-checkstyle && chmod 0755 typos-checkstyle
./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:14.17'
reuseNode true
}
}
steps {
sh('yarn install')
}
}
stage('Build Production') {
agent {
docker {
image 'node:14.17'
reuseNode true
}
}
steps {
sh('yarn build')
}
}
stage('Check build') {
agent {
docker {
image 'node:14.17'
reuseNode true
}
}
steps {
sh 'test -e ./plugins/plugin-site/public/index.html || exit 1'
}
}
stage('Lint and Test') {
environment {
NODE_ENV = "development"
}
agent {
docker {
image 'node:14.17'
reuseNode true
}
}
steps {
sh('yarn lint')
sh('yarn test')
}
}
}
}