-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
196 lines (162 loc) · 6.37 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
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
buildscript {
repositories {
mavenCentral()
maven { url "https://plugins.gradle.org/m2" }
maven { url "https://dl.bintray.com/seu-as-code/gradle-plugins" }
}
dependencies {
classpath "nl.javadude.gradle.plugins:license-gradle-plugin:0.11.0"
classpath "com.bmuschko:gradle-docker-plugin:2.6.6"
classpath 'de.qaware.seu.as.code:seuac-credentials-plugin:2.4.0.RC3'
}
}
subprojects {
group = 'de.qaware.sandbox.zwitscher'
version = '1.0.0-SNAPSHOT'
apply plugin: 'java'
apply plugin: "com.github.hierynomus.license"
apply plugin: 'com.bmuschko.docker-remote-api'
apply plugin: 'de.qaware.seu.as.code.credentials'
sourceCompatibility = 1.8
targetCompatibility = 1.8
license {
skipExistingHeaders = true
header rootProject.file('LICENSE')
includes(["**/*.java"])
mapping {
java = 'SLASHSTAR_STYLE'
}
}
ext {
kumuluzVersion = '2.0.0'
jerseyVersion = '2.17' //required by KumuluzEE 2.0.0
weldVersion = '2.3.3.Final' //required by KumuluzEE 2.0.0
deltaSpikeVersion = '1.7.1'
metricsVersion = '3.1.2'
hystrixVersion = '1.5.5'
}
dependencies {
//KumuluzEE micro JEE container
compile "com.kumuluz.ee:kumuluzee-core:$kumuluzVersion"
compile "com.kumuluz.ee:kumuluzee-servlet-jetty:$kumuluzVersion"
compile "com.kumuluz.ee:kumuluzee-jax-rs-jersey:$kumuluzVersion"
compile "com.kumuluz.ee:kumuluzee-cdi-weld:$kumuluzVersion"
//Consul service discovery and utils
compile "com.ecwid.consul:consul-api:1.1.11"
compile "io.mikael:urlbuilder:2.0.7"
//Hystric resiliency
compile "org.glassfish.jersey.ext.rx:jersey-rx-client-rxjava:$jerseyVersion"
compile "com.netflix.hystrix:hystrix-core:$hystrixVersion"
compile "com.netflix.hystrix:hystrix-metrics-event-stream:$hystrixVersion"
compile "com.netflix.hystrix:hystrix-codahale-metrics-publisher:$hystrixVersion"
//Metrics diagnosability
compile "io.dropwizard.metrics:metrics-core:$metricsVersion"
compile "io.dropwizard.metrics:metrics-healthchecks:$metricsVersion"
compile "io.dropwizard.metrics:metrics-servlets:$metricsVersion"
compile "io.dropwizard.metrics:metrics-jersey2:$metricsVersion"
//Logging with SLF4J
compile "org.slf4j:slf4j-simple:1.7.21"
//Prometheus integration
compile group: 'io.prometheus', name: 'simpleclient', version: '0.0.16'
compile group: 'io.prometheus', name: 'client', version: '0.0.10'
compile group: 'io.prometheus', name: 'simpleclient_servlet', version: '0.0.16'
compile group: 'io.prometheus.client.utility', name: 'servlet', version: '0.0.10'
compile group: 'io.prometheus', name: 'simpleclient_dropwizard', version: '0.0.16'
// cfg4j integration
compile "org.cfg4j:cfg4j-core:4.4.0"
compile "org.cfg4j:cfg4j-consul:4.4.0"
//Google Guava
compile "com.google.guava:guava:19.0"
//Testing framework
testCompile "org.hamcrest:hamcrest-all:1.3"
testCompile "junit:junit:4.12"
//Apache DeltaSpike JEE testing facility
testCompile "org.apache.deltaspike.modules:deltaspike-test-control-module-impl:$deltaSpikeVersion"
testRuntime "org.apache.deltaspike.modules:deltaspike-test-control-module-api:$deltaSpikeVersion"
testRuntime "org.apache.deltaspike.cdictrl:deltaspike-cdictrl-weld:$deltaSpikeVersion"
testRuntime "org.jboss.weld.se:weld-se-core:$weldVersion"
}
configurations {
compile.exclude group: "org.apache.cxf"
}
//copy all jar dependencies into dependency folder after build (required by KumuluzEE)
task copyDependencies(type: Copy) {
from configurations.compile
into 'build/dependency'
}
build.finalizedBy(copyDependencies)
//copy all resources into classes folder (required by KumuluzEE and Deltaspike)
sourceSets {
main {
output.resourcesDir = "build/classes"
output.classesDir = 'build/classes'
}
}
/**
configurations.all {
resolutionStrategy {
// fail eagerly on version conflict (includes transitive dependencies)
// e.g. multiple different versions of the same dependency (group and name are equal)
failOnVersionConflict()
}
}*/
docker {
url = System.env.DOCKER_HOST ?: 'https://192.168.99.100:2376'
certPath = file("${System.getProperty('user.home')}/.docker/machine/machines/default")
registryCredentials {
username = project.credentials['docker'].username
password = project.credentials['docker'].password
}
}
repositories {
mavenCentral()
jcenter()
}
task buildDockerImage(type: DockerBuildImage, dependsOn: "build") {
inputDir = projectDir
noCache = false
remove = true
tag = "adersberger/$project.name:$version"
}
task removeDockerImage(type: DockerRemoveImage) {
imageId = "adersberger/$project.name:$version"
}
task pushDockerImage(type: DockerPushImage) {
imageName = "adersberger/$project.name:$version"
}
}
import com.bmuschko.gradle.docker.tasks.DockerInfo
import com.bmuschko.gradle.docker.tasks.DockerVersion
import com.bmuschko.gradle.docker.tasks.image.DockerBuildImage
import com.bmuschko.gradle.docker.tasks.image.DockerPushImage
import com.bmuschko.gradle.docker.tasks.image.DockerRemoveImage
task dockerInfo(type: DockerInfo) {}
task dockerVersion(type: DockerVersion) {}
task deployToMarathon(type: Exec) {
workingDir './infrastructure'
commandLine './marathonized-up.sh'
}
task undeployFromMarathon(type: Exec) {
workingDir './infrastructure'
commandLine './marathonized-down.sh'
}
task deployToDocker(type: Exec) {
workingDir './infrastructure'
commandLine './dockerized-up.sh'
}
task undeployFromDocker(type: Exec) {
workingDir './infrastructure'
commandLine './dockerized-down.sh'
}
task startLocalConsul(type: Exec) {
workingDir './infrastructure'
commandLine './local-consul-up.sh'
}
task startLocalFabio(type: Exec) {
workingDir './infrastructure'
commandLine './local-fabio-up.sh'
}
task startLocalPrometheus(type: Exec) {
workingDir './infrastructure'
commandLine './local-prometheus-up.sh'
}