-
Notifications
You must be signed in to change notification settings - Fork 54
/
website.gradle
68 lines (51 loc) · 2.01 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
66
67
68
import name.neuhalfen.concordion.transform.ConcordionHtmlToMarkdownTransformer
// Publishes the Concordion output to Github Pages
// https://github.com/ajoberstar/gradle-git-publish
tasks.register('prepareSpecsForCMS', Copy) {
setDependsOn(['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)
}
tasks.register('removeOldCMSBuild', Delete) {
delete "${specifications_cms_target}"
delete "${cms_BuildRoot}"
}
tasks.register('prepareCmsBuildRoot', Copy) {
dependsOn['removeOldCMSBuild']
from("${specifications_cms_cmsdRoot}")
into "${cms_BuildRoot}"
}
tasks.register('generateWebsite', Exec) {
dependsOn['prepareSpecsForCMS']
commandLine = [hugo, '--cleanDestinationDir', '--destination', "${specifications_cms_target}", '--enableGitInfo']
workingDir = file("${cms_BuildRoot}")
}
tasks.register('previewWebsite', Exec) {
dependsOn['generateWebsite']
commandLine = [hugo, 'server', '--debug', '--watch', '--enableGitInfo']
workingDir = file("${cms_BuildRoot}")
}
gitPublish {
// where to publish to (repo must exist)
repoUri = 'git@github.com: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'
}
tasks.register('publishWebsite') { setDependsOn(['generateWebsite', 'gitPublishPush']) }