-
Notifications
You must be signed in to change notification settings - Fork 19
/
Jenkinsfile
40 lines (35 loc) · 1.15 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
pipeline {
agent any
tools { nodejs "Node 16" }
options {
buildDiscarder(logRotator(artifactNumToKeepStr: "5"))
copyArtifactPermission('/*-AniList-Node');
}
stages {
stage('Prepare') {
environment {
projVersion = sh(script: 'npm pkg get version | sed "s/^.//g" | sed "s/.$//"', , returnStdout: true).trim()
gitRevision = '${GIT_REVISION,length=6}'
buildCount = '${BUILD_NUMBER}'
}
steps {
buildName "${projVersion}.${buildCount}.${gitRevision}"
sh 'npm install'
}
}
stage('Test') {
steps {
sh 'npm run eslint'
}
}
stage('Build') {
steps {
sh 'npm run docs'
script {
zip zipFile: "anilist-node-built-${BUILD_NUMBER}.zip", archive: false, dir: 'docs'
}
archiveArtifacts artifacts: "anilist-node-built-${BUILD_NUMBER}.zip", fingerprint: true, followSymlinks: false, onlyIfSuccessful: true
}
}
}
}