-
-
Notifications
You must be signed in to change notification settings - Fork 8
/
Jenkinsfile
76 lines (68 loc) · 1.59 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
pipeline {
options {
timeout(time: 60, unit: 'MINUTES')
ansiColor('xterm')
disableConcurrentBuilds(abortPrevious: true)
buildDiscarder logRotator(artifactDaysToKeepStr: '', artifactNumToKeepStr: '', daysToKeepStr: '', numToKeepStr: '5')
}
agent {
label 'linux-arm64-docker || arm64linux'
}
environment {
NODE_ENV = 'production'
TZ = "UTC"
NETLIFY = "true"
}
stages {
stage('Check for typos') {
steps {
sh '''typos --format json | typos-checkstyle - > checkstyle.xml || true'''
}
post {
always {
recordIssues(tools: [checkStyle(id: 'typos', name: 'Typos', pattern: 'checkstyle.xml')])
}
}
}
stage('Install Dependencies') {
environment {
NODE_ENV = 'development'
}
steps {
sh 'asdf install'
sh 'npm ci'
}
}
stage('Lint') {
steps {
sh '''
npx eslint --format checkstyle . > eslint-results.json
'''
}
post {
always {
recordIssues(
enabledForFailure: true,
tools: [
esLint(pattern: 'eslint-results.json'),
])
}
}
}
stage('Test') {
steps {
sh 'npm run test --if-present'
}
}
stage('Build') {
steps {
sh 'npm run build --if-present'
}
}
stage('Release') {
steps {
buildDockerAndPublishImage('incrementals-publisher', [automaticSemanticVersioning: true, targetplatforms: 'linux/amd64,linux/arm64', disablePublication: !infra.isInfra()])
}
}
}
}