-
Notifications
You must be signed in to change notification settings - Fork 1
/
build.gradle
92 lines (67 loc) · 2.46 KB
/
build.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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
buildscript {
repositories {
maven { url "${artifactRepoURL}/repository/attx-releases"}
}
dependencies {
classpath "org.uh.hulib.attx.gradle:gradle-pullrequest-builder:1.6-SNAPSHOT"
}
}
plugins {
id "com.moowork.node" version "1.2.0"
}
apply plugin: "attx.pullrequest.gradle.github"
apply plugin: 'com.moowork.node'
apply plugin: 'base'
node {
// Version of node to use.
version = '7.10.0'
// Version of npm to use.
npmVersion = '4.2.0'
// Base URL for fetching node distributions (change if you have a mirror).
distBaseUrl = 'http://nodejs.org/dist'
// If true, it will download node using above parameters.
// If false, it will try to use globally installed node.
download = true
workDir = file("${project.buildDir}/attx_project")
}
task installDependencies(type: Exec, dependsOn: 'npmInstall') {
inputs.dir('${project.projectDir}/attx_project')
executable = 'node_modules/.bin/gitbook'
args = ['install', './attx_project', "${project.buildDir}", "--verbose"]
}
task buildDocs(type: Exec, dependsOn: 'npmInstall') {
dependsOn installDependencies
inputs.dir('${project.projectDir}/attx_project')
executable = 'node_modules/.bin/gitbook'
args = ['build', './attx_project', "${project.buildDir}", "--verbose"]
}
task serveDocs(type:Exec, dependsOn: 'npmInstall') {
dependsOn installDependencies
inputs.dir('${project.projectDir}/attx_project')
executable = 'node_modules/.bin/gitbook'
args = ['serve', './attx_project', "${project.buildDir}", '--verbose']
}
task distributeDocs(type: Copy) {
dependsOn buildDocs
from "${project.buildDir}"
into "${project.projectDir}"
}
gitCommit.dependsOn distributeDocs
gitPullRequest {
// where to publish to (repo must exist)
githubUri = 'https://github.com/ATTX-project/ATTX-project.github.io'
// github user name to use
user = "${user}"
// github password or better access token
accessToken = "${token}"
// the name the branch should start with (will be added by timestamp to avoid collisions)
branchSuffix = 'dev'
// the target branch to send pull request to
master = 'master'
// // optional, the folder to commit all new or changed files from (default=src)
// source = '.'
// optional, the title of the pull request
title = "Automatic pull request: Jenkins build#${jenkinsBuild}"
// // optional, the message of the commit
message = "Commited by Jenkins build#${jenkinsBuild}."
}