-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
75 lines (59 loc) · 2.27 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
import java.time.Duration
import java.time.Instant
apply plugin: "idea"
apply plugin: 'jacoco'
apply plugin: 'java'
apply plugin: 'spring-boot'
sourceCompatibility = 1.8
targetCompatibility = 1.8
repositories {
mavenCentral()
}
group = "io.aattila"
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath(group: 'org.springframework.boot', name: 'spring-boot-gradle-plugin', version: springBootVersion)
classpath(group: 'org.hidetake', name: 'gradle-ssh-plugin', version: '2.2.0')
}
}
gradle.taskGraph.beforeTask { Task task ->
task.ext.setProperty("startTime", Instant.now())
}
gradle.taskGraph.afterTask { Task task, TaskState state ->
println task.name + " duration: " + Duration.between(task.ext.startTime, Instant.now()).toSeconds() + " seconds \n"
}
ext {
resourcesDir = projectDir.path + "/config/resources"
generatedDir = projectDir.path + "/src/generated/resources"
}
sourceSets {
generated
}
dependencies {
compile(group: 'org.springframework.boot', name: 'spring-boot-starter-actuator', version: springBootVersion)
compile(group: 'org.springframework.boot', name: 'spring-boot-starter-web', version: springBootVersion)
compile(group: 'org.springframework.boot', name: 'spring-boot-starter-thymeleaf', version: springBootVersion)
compile(group: 'org.springframework.boot', name: 'spring-boot-starter-security', version: springBootVersion)
compile(group: 'org.json', name: 'json', version: '20180130')
testCompile(group: 'org.springframework.boot', name: 'spring-boot-starter-test', version: springBootVersion)
testCompile(group: 'com.github.stefanbirkner', name: 'system-rules', version: '1.16.0')
testCompile group: 'junit', name: 'junit', version: '4.12'
}
task deploy() {
dependsOn assemble
doLast {
def remoteDir = "${baseDir}"
ssh.run {
session(remotes.role('singlepi')) {
put from: jar.archivePath, into: "${remoteDir}/lib"
execute "chmod 775 ${remoteDir}/lib/${jar.archiveName}"
execute "ln -f -s ${remoteDir}/lib/${jar.archiveName} ${remoteDir}/lib/latest"
execute "/usr/bin/sudo /usr/bin/systemctl restart rly8"
println "deployed"
}
}
}
}