-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
139 lines (114 loc) · 4.06 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
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
plugins {
id 'org.springframework.boot' version '2.6.4'
id 'io.spring.dependency-management' version '1.0.11.RELEASE'
id 'java'
id 'distribution'
id 'org.hidetake.ssh' version '2.10.1'
}
group 'org.example'
version '0.1'
repositories {
mavenCentral()
}
distributions {
main {
version = ''
contents {
into('config') {
from 'config'
}
into ('lib') {
from jar
from(configurations.runtimeClasspath)
}
from 'runscripts'
}
}
}
remotes {
master {
host = '192.168.10.100'
user = 'testbed'
password = 'root'
//identity = file(System.getProperty("user.home") + System.getProperty("file.separator")
// + ".ssh" + System.getProperty("file.separator") + "id_rsa")
}
}
ssh.settings {
fileTransfer = 'scp'
}
task remoteDeploy (dependsOn: installDist) {
doLast {
ssh.run {
session(remotes.master) {
put from: "build/install/${project.name}", into: '~/'
}
}
}
}
task localDeploy (dependsOn: installDist) {
doLast {
int[] replicas = new int[]{0, 1, 2, 3}
int[] proxy = new int[]{0, 1}
int[] clients = new int[]{0, 1}
int[] managers = new int[]{0}
String dst = System.getProperty("user.home") + System.getProperty("file.separator") +
"Desktop" + System.getProperty("file.separator") +
project.name + System.getProperty("file.separator")
println ("Deploying project into ${dst}")
replicas.each {
def target = dst + System.getProperty("file.separator") + "rep${it}"
copy {
from "build/install/${project.name}"
into target
}
}
proxy.each {
def target = dst + System.getProperty("file.separator") + "pro${it}"
copy {
from "build/install/${project.name}"
into target
}
}
clients.each {
def target = dst + System.getProperty("file.separator") + "cli${it}"
copy {
from "build/install/${project.name}"
into target
}
}
managers.each {
def target = dst + System.getProperty("file.separator") + "man${it}"
copy {
from "build/install/${project.name}"
into target
}
}
}
}
dependencies {
implementation fileTree('libs') {include '*.jar'}
implementation 'com.google.code.gson:gson:2.9.0'
// https://mvnrepository.com/artifact/org.bouncycastle/bcpkix-jdk15on
implementation 'org.bouncycastle:bcpkix-jdk15on:1.69'
// https://mvnrepository.com/artifact/org.bouncycastle/bcprov-jdk15on
implementation 'org.bouncycastle:bcprov-jdk15on:1.69'
// https://mvnrepository.com/artifact/commons-codec/commons-codec
implementation 'commons-codec:commons-codec:1.15'
// https://mvnrepository.com/artifact/ch.qos.logback/logback-core
implementation 'ch.qos.logback:logback-core:1.2.5'
// https://mvnrepository.com/artifact/ch.qos.logback/logback-classic
implementation 'ch.qos.logback:logback-classic:1.2.5'
// https://mvnrepository.com/artifact/io.netty/netty-all
implementation 'io.netty:netty-all:4.1.67.Final'
// https://mvnrepository.com/artifact/org.slf4j/slf4j-api
implementation 'org.slf4j:slf4j-api:1.7.32'
// https://mvnrepository.com/artifact/com.google.protobuf/protobuf-java
implementation group: 'com.google.protobuf', name: 'protobuf-java', version: '3.17.3'
// https://mvnrepository.com/artifact/org.codehaus.groovy/groovy-all
//mplementation group: 'org.codehaus.groovy', name: 'groovy-all', version: '2.4.4'
implementation 'org.codehaus.groovy:groovy:3.0.8'
implementation 'org.springframework.boot:spring-boot-starter'
implementation 'org.springframework.boot:spring-boot-starter-web'
testImplementation 'org.springframework.boot:spring-boot-starter-test'
}