3
3
*/
4
4
5
5
def buildDocsDir = " $buildDir /docs"
6
+ def jekyllDockerImage = " jekyll/jekyll:$jekyll_version "
6
7
7
8
task copyDocs (type : Copy , dependsOn : rootProject. getTasksByName(" dokka" , true )) {
8
9
from (rootProject. getTasksByName(" dokka" , true ). collect { " $it . project . buildDir /dokka" }) {
@@ -23,7 +24,17 @@ task site(type: Exec, description: 'Generate github pages', dependsOn: [copyDocs
23
24
inputs. files(fileTree(buildDocsDir))
24
25
outputs. dir(" $buildDir /dist" )
25
26
workingDir file(buildDocsDir)
26
- commandLine ' bundle' , ' exec' , ' jekyll' , ' build'
27
+ commandLine ' docker' , ' run' , ' --rm' , " --volume=$buildDir :/srv/jekyll" ,
28
+ ' -t' , jekyllDockerImage,
29
+ ' /bin/bash' , ' -c' , ' cd docs; jekyll build'
30
+ }
31
+
32
+ // A useful task for local debugging -- serves a site locally
33
+ task serve (type : Exec , dependsOn : [copyDocs, copyExampleFrontendJs]) {
34
+ commandLine ' docker' , ' run' , ' --rm' , " --volume=$buildDir :/srv/jekyll" ,
35
+ ' -p' , ' 8080:8080' ,
36
+ ' -t' , jekyllDockerImage,
37
+ ' /bin/bash' , ' -c' , ' cd docs; jekyll serve --host 0.0.0.0 --port 8080'
27
38
}
28
39
29
40
task clean (type : Delete ) {
0 commit comments