-
Notifications
You must be signed in to change notification settings - Fork 16
Expand file tree
/
Copy pathJenkinsfile
More file actions
77 lines (71 loc) · 1.66 KB
/
Jenkinsfile
File metadata and controls
77 lines (71 loc) · 1.66 KB
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
pipeline {
agent any
options {
timestamps()
disableConcurrentBuilds()
}
environment {
BUNDLE_PATH = "vendor/bundle"
JEKYLL_ENV = "production"
}
stages {
stage("Install Dependencies") {
steps {
script {
if (isUnix()) {
sh """
set -e
bundle config set path "${BUNDLE_PATH}"
bundle install --jobs 4 --retry 3
"""
} else {
bat """
@echo off
if exist C:\\Ruby34-x64\\bin\\bundle.bat (
C:\\Ruby34-x64\\bin\\bundle.bat config set path "%BUNDLE_PATH%"
C:\\Ruby34-x64\\bin\\bundle.bat install --jobs 4 --retry 3
) else (
bundle config set path "%BUNDLE_PATH%"
bundle install --jobs 4 --retry 3
)
"""
}
}
}
}
stage("Build Site") {
steps {
script {
if (isUnix()) {
sh "bundle exec jekyll build"
} else {
bat """
@echo off
if exist C:\\Ruby34-x64\\bin\\bundle.bat (
C:\\Ruby34-x64\\bin\\bundle.bat exec jekyll build
) else (
bundle exec jekyll build
)
"""
}
}
}
}
stage("Generate Pagefind Index") {
steps {
script {
if (isUnix()) {
sh "npx -y pagefind --site _site"
} else {
bat "npx -y pagefind --site _site"
}
}
}
}
}
post {
success {
archiveArtifacts artifacts: "_site/**", fingerprint: true
}
}
}