forked from neuhalje/bouncy-gpg
-
Notifications
You must be signed in to change notification settings - Fork 0
/
website.gradle
65 lines (47 loc) · 1.95 KB
/
website.gradle
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
import name.neuhalfen.concordion.transform.ConcordionHtmlToMarkdownTransformer
// Publishes the Concordion output to Github Pages
// https://github.com/ajoberstar/gradle-git-publish
task prepareSpecsForCMS(type: Copy, dependsOn: ['prepareCmsBuildRoot', 'test']) {
description 'Transform the build output of concordion to include it in the CMS'
from(fileTree("${specifications_prepareForCms_source}")) {
include '**/*.html'
}
into(file("${specifications_prepareForCms_target}"))
filter(ConcordionHtmlToMarkdownTransformer)
}
task removeOldCMSBuild(type: Delete) {
delete "${specifications_cms_target}"
delete "${cms_BuildRoot}"
}
task prepareCmsBuildRoot(type: Copy, dependsOn: ['removeOldCMSBuild']) {
from("${specifications_cms_cmsdRoot}")
into "${cms_BuildRoot}"
}
task generateWebsite(type: Exec, dependsOn: ['prepareSpecsForCMS']) {
commandLine = [hugo, '--cleanDestinationDir', '--destination', "${specifications_cms_target}", '--enableGitInfo']
workingDir = file("${cms_BuildRoot}")
}
task previewWebsite(type: Exec, dependsOn: ['generateWebsite']) {
commandLine = [hugo, 'server', '--debug', '--watch', '--enableGitInfo']
workingDir = file("${cms_BuildRoot}")
}
gitPublish {
// where to publish to (repo must exist)
repoUri = '[email protected]:neuhalje/bouncy-gpg.git'
// branch will be created if it doesn't exist
branch = 'gh-pages'
// generally, you don't need to touch this
// repoDir = file("$buildDir/gitPublish")
// what to publish, this is a standard CopySpec
contents {
from "${specifications_cms_target}"
}
// what to keep in the existing branch (include=keep)
preserve {
include '1.0.0/**'
exclude '1.0.0/temp.txt'
}
// message used when committing changes
commitMessage = 'Publishing github pages' // defaults to 'Generated by gradle-git-publish'
}
task publishWebsite(dependsOn: ['generateWebsite', 'gitPublishPush'])