-
Notifications
You must be signed in to change notification settings - Fork 3
/
servers.gradle
127 lines (125 loc) · 4.88 KB
/
servers.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
ext {
debugOptions = 'JAVA_OPTS="$JAVA_OPTS -Xrunjdwp:transport=dt_socket,address=8787,server=y,suspend=n"'
servers = [
'spring-boot': [
javaVersions: ["1.6", "1.7", "1.8"],
openJdk : true,
install : {},
start : { testDir, props -> executeInBackground("./mvnw --batch-mode clean spring-boot:run", testDir) },
stop : {proc ->
proc.destroy()
proc.waitFor()
execute("pkill -9 -f spring-boot")
},
deploy : { testDir, props -> }
],
// 'jboss-6.1' : [
// javaVersions: ["1.6", "1.7"],
// downloadUrl : "http://download.jboss.org/jbossas/6.1/jboss-as-distribution-6.1.0.Final.zip",
// install : {
// copy {
// from zipTree(file(".downloads/jboss-as-distribution-6.1.0.Final.zip"))
// into "$buildDir/servers/"
// }
// file("$buildDir/servers/jboss-6.1.0.Final/bin/standalone.conf").append("\n$debugOptions")
// },
// start : { testDir, props -> executeInBackground("$buildDir/servers/jboss-6.1.0.Final/bin/run.sh") },
// stop : { execute("$buildDir/servers/jboss-6.1.0.Final/bin/shutdown.sh -S") },
// deploy : { testDir, props ->
// copy {
// from "$testDir/${props.deploymentFiles}"
// into "$buildDir/servers/jboss-6.1.0.Final/deploy/"
// }
// }
// ],
'jboss-7.1' : [
javaVersions: ["1.6", "1.7"],
openJdk : false,
downloadUrl : "http://download.jboss.org/jbossas/7.1/jboss-as-7.1.1.Final/jboss-as-7.1.1.Final.zip",
install : {
copy {
from zipTree(file(".downloads/jboss-as-7.1.1.Final.zip"))
into "$buildDir/servers/"
}
file("$buildDir/servers/jboss-as-7.1.1.Final/bin/standalone.conf").append("\n$debugOptions")
},
start : { testDir, props -> executeInBackground("$buildDir/servers/jboss-as-7.1.1.Final/bin/standalone.sh") },
stop : {
execute("$buildDir/servers/jboss-as-7.1.1.Final/bin/jboss-cli.sh --connect command=:shutdown")
},
deploy : { testDir, props ->
def src = "$testDir/${props.deploymentFiles}"
def dest = "$buildDir/servers/jboss-as-7.1.1.Final/standalone/deployments/"
assert file(src).exists()
assert file(dest).exists()
println "copy from $src to $dest"
copy {
from src
into dest
}
println "deployments:"
file(dest).eachFile { println it }
}
],
'wildfly-10' : [
javaVersions: ["1.8"],
openJdk : true,
downloadUrl : "http://download.jboss.org/wildfly/10.1.0.Final/wildfly-10.1.0.Final.zip",
install : {
copy {
from zipTree(file(".downloads/wildfly-10.1.0.Final.zip"))
into "$buildDir/servers/"
}
file("$buildDir/servers/wildfly-10.1.0.Final/bin/standalone.conf").append("\n$debugOptions")
},
start : { testDir, props -> executeInBackground("$buildDir/servers/wildfly-10.1.0.Final/bin/standalone.sh") },
stop : {
execute("$buildDir/servers/wildfly-10.1.0.Final/bin/jboss-cli.sh --connect command=:shutdown")
},
deploy : { testDir, props ->
def src = "$testDir/${props.deploymentFiles}"
def dest = "$buildDir/servers/wildfly-10.1.0.Final/standalone/deployments/"
assert file(src).exists()
assert file(dest).exists()
println "copy from $src to $dest"
copy {
from src
into dest
}
println "deployments:"
file(dest).eachFile { println it }
}
],
'tomcat-6' : tomcat("6.0.44", ["1.6", "1.7"], "http://archive.apache.org/dist/tomcat/tomcat-6/v6.0.44/bin/apache-tomcat-6.0.44.zip"),
'tomcat-7' : tomcat("7.0.67", ["1.6", "1.7", "1.8"], "http://archive.apache.org/dist/tomcat/tomcat-7/v7.0.67/bin/apache-tomcat-7.0.67.zip"),
'tomcat-8' : tomcat("8.0.24", ["1.6", "1.7", "1.8"], "http://archive.apache.org/dist/tomcat/tomcat-8/v8.0.24/bin/apache-tomcat-8.0.24.zip")
]
}
def tomcat(String version, List<String> javaVersions, String downloadUrl) {
[
javaVersions: javaVersions,
downloadUrl : downloadUrl,
openJdk : true,
install : {
copy {
from zipTree(file(".downloads/apache-tomcat-${version}.zip"))
into "$buildDir/servers/"
}
file("$buildDir/servers/apache-tomcat-${version}/bin/setenv.sh") << debugOptions.replace("JAVA_OPTS", "CATALINA_OPTS")
execute("chmod 744 $buildDir/servers/apache-tomcat-${version}/bin/*.sh")
},
start : { testDir, props -> executeInBackground("$buildDir/servers/apache-tomcat-${version}/bin/catalina.sh run") },
stop : {
execute("$buildDir/servers/apache-tomcat-${version}/bin/catalina.sh stop 40")
execute("pkill -9 -f $buildDir/servers/apache-tomcat-${version}")
},
deploy : { testDir, props ->
String src = "$testDir/${props.deploymentFiles}"
assert file(src).exists()
copy {
from src
into "$buildDir/servers/apache-tomcat-${version}/webapps"
}
}
]
}