-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathbuild.gradle
71 lines (53 loc) · 1.4 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
repositories {
mavenCentral()
}
configurations {
antScpClasspath
}
dependencies {
antScpClasspath 'org.apache.ant:ant-jsch:1.+'
}
ant.taskdef(
name: 'scp',
classname: 'org.apache.tools.ant.taskdefs.optional.ssh.Scp',
classpath: configurations.antScpClasspath.asPath
)
task hugo(type:Exec) {
workingDir '.'
commandLine '/usr/local/bin/hugo'
}
task gallery(type:Exec) {
workingDir 'Gallery/Linz2016'
commandLine '/usr/local/bin/sigal', 'build', 'Images', '../../public/gallery/Linz2016'
}
task upload() {
doLast {
def uploadHost = ""
if (project.ext.properties.containsKey("uploadHost")) {
uploadHost = project.ext.uploadHost
} else {
uploadHost = System.console().readLine('Please enter the hostname: ')
}
def uploadUser = ""
if (project.ext.properties.containsKey("uploadUser")) {
uploadUser = project.ext.uploadUser
} else {
uploadUser = System.console().readLine('Please enter the username: ')
}
def uploadPassword = ""
if (project.ext.properties.containsKey("uploadPassword")) {
uploadPassword = project.ext.uploadPassword
} else {
def password = System.console().readPassword('Please enter the password: ')
uploadPassword = new String(password)
}
ant.scp(
todir: uploadUser + '@' + uploadHost + ':~/socrates/',
port: 22,
password: uploadPassword) {
fileset(dir: 'public') {
include(name: '**/**')
}
}
}
}