-
Notifications
You must be signed in to change notification settings - Fork 2
/
build.gradle
92 lines (73 loc) · 2.02 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
//plugins {
// id "de.gesellix.docker" version "2016-09-09T17-53-52"
//}
apply plugin: 'java'
version = '1.1.0'
sourceCompatibility = 1.7
targetCompatibility = 1.7
repositories {
// jcenter()
mavenLocal()
mavenCentral()
}
dependencies {
compileOnly 'javax.servlet:servlet-api:2.5'
compileOnly 'commons-lang:commons-lang:2.6'
compileOnly ('edu.internet2.middleware.grouper:grouper:4.10.1') {
transitive = false
}
compileOnly ('edu.internet2.middleware.grouper:grouper-ui:4.10.1') {
transitive = false
}
compileOnly ('edu.internet2.middleware.grouper:grouperClient:4.10.1') {
transitive = false
}
compileOnly 'org.slf4j:slf4j-api:1.7.32'
compileOnly 'org.hibernate:hibernate-core:5.6.10.Final'
compileOnly 'commons-logging:commons-logging:1.2'
}
//docker {
// dockerHost = System.env['DOCKER_HOST']?.replace("tcp", "http");
//}
task copyDocker(type: Copy) {
from 'src/test/docker-compose/'
into 'build/docker-compose/'
}
task copyJspToDocker(type: Copy) {
dependsOn copyDocker
from 'src/main/webapp/'
into 'build/docker-compose/grouper/webapp'
}
task addLib(type: Copy) {
dependsOn jar
from 'build/libs/'
into 'build/docker-compose/grouper/lib/'
}
task buildImage(type: Exec) {
dependsOn copyDocker, copyJspToDocker, addLib
doFirst {
logger.lifecycle("Building the initial images may take a long time. Have plenty of bandwidth.")
}
workingDir 'build/docker-compose'
commandLine 'docker-compose', 'build'
}
task runContainer(type: Exec) {
dependsOn buildImage
workingDir 'build/docker-compose'
commandLine 'docker-compose', 'up', '-d'
}
task stopContainer(type: Exec) {
workingDir 'build/docker-compose'
commandLine 'docker-compose', 'kill'
}
task removeContainer(type: Exec) {
dependsOn stopContainer
workingDir 'build/docker-compose'
commandLine 'docker-compose', 'rm', '-f'
}
task resetContainer() {
dependsOn removeContainer
}
clean {
dependsOn resetContainer
}