-
Notifications
You must be signed in to change notification settings - Fork 16
/
build.gradle
126 lines (109 loc) · 4.03 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
apply plugin: 'java'
apply plugin: 'maven'
group = 'com.turn'
version = '0.1.5-2016011901'
ext.image = rootProject.name
ext.urlDev = 'docker-dev.turn.com:5000'
ext.urlProd = 'docker.turn.com'
ext.namespace = '/turn-tsdb/'
ext.tagDev = urlDev + namespace + image + ':' + version
ext.tagProd = urlProd + namespace + image + ':' + version
description = "This project implements a TSDB Splicer, which will " +
"partition long TSDB queries into smaller chunks, execute them in parallel, and splice the " +
"individual results"
sourceCompatibility = 1.7
targetCompatibility = 1.7
repositories {
flatDir {
dirs 'libs'
}
maven { url "http://repo.maven.apache.org/maven2" }
mavenCentral()
}
configurations{
providedCompile
compile.extendsFrom providedCompile
}
dependencies {
compile group: 'com.google.guava', name: 'guava', version:'18.0'
compile group: 'org.eclipse.jetty', name: 'jetty-server', version:'8.1.16.v20140903'
compile group: 'org.eclipse.jetty', name: 'jetty-servlet', version:'8.1.16.v20140903'
compile(group: 'org.apache.hbase', name: 'hbase-client', version:'0.98.0-hadoop1') {
exclude(module: 'slf4j-log4j12')
exclude(module: 'org.codehaus.jackson')
}
compile group: 'org.apache.httpcomponents', name: 'httpclient', version:'4.5'
compile group: 'com.google.code.findbugs', name: 'jsr305', version:'3.0.0'
compile group: 'com.fasterxml.jackson.core', name: 'jackson-core', version:'2.4.3'
compile group: 'com.fasterxml.jackson.core', name: 'jackson-databind', version:'2.4.3'
compile group: 'com.fasterxml.jackson.core', name: 'jackson-annotations', version:'2.4.3'
compile group: 'org.slf4j', name: 'slf4j-api', version:'1.7.7'
compile group: 'org.slf4j', name: 'log4j-over-slf4j', version:'1.7.7'
compile group: 'ch.qos.logback', name: 'logback-core', version:'1.0.13'
compile group: 'ch.qos.logback', name: 'logback-classic', version:'1.0.13'
compile group: 'redis.clients', name: 'jedis', version:'2.7.2'
compile group: 'com.stumbleupon', name: 'async', version:'1.4.0'
compile group: 'org.apache.commons', name: 'commons-math3', version:'3.4.1'
providedCompile files('libs/tsdb-2.3.0-SNAPSHOT.jar')
testCompile group: 'org.hbase', name: 'asynchbase', version:'1.7.1'
testCompile group: 'org.testng', name: 'testng', version:'6.8'
testCompile group: 'junit', name: 'junit', version:'4.11'
testCompile group: 'org.mockito', name: 'mockito-core', version:'1.9.5'
}
task fatJar(type: Jar, dependsOn: build) {
baseName = project.name + '-all'
from {
configurations.compile.collect {
it.isDirectory() ? it : zipTree(it).matching {
exclude {
it.path.contains('META-INF')
}
}
}
}
with jar
}
task generateVersion(type: Exec) {
workingDir 'docker'
commandLine './version.sh'
}
task copyJar(type: Copy, dependsOn: fatJar) {
from('build/libs') {
include fatJar.archiveName
}
into('docker')
}
task copyConfig(type: Copy) {
from('src/main/resources') {
include '*'
}
into('docker/resources')
}
task buildDockerImage(type: Exec, dependsOn: ['copyJar', 'copyConfig', 'generateVersion']) {
commandLine 'docker', 'build', '-t', image, './docker'
}
task tagDockerDevImage(type: Exec, dependsOn: buildDockerImage) {
commandLine 'docker', 'tag', '-f', image, tagDev
}
task tagDockerProdImage(type: Exec, dependsOn: buildDockerImage) {
commandLine 'docker', 'tag', '-f', image, tagProd
}
task pushDockerDevImage(type: Exec, dependsOn: tagDockerDevImage) {
commandLine 'docker', 'push', tagDev
}
task pushDockerProdImage(type: Exec, dependsOn: tagDockerProdImage) {
environment 'HOME', '.'
commandLine 'docker', 'push', tagProd
}
task getDeps(type: Copy) {
from sourceSets.main.runtimeClasspath
into 'runtime/'
}
clean.doLast {
def cmd = "rm -f docker/${fatJar.archiveName}"
println cmd
cmd.execute()
cmd = "rm -rf docker/resources"
println cmd
cmd.execute()
}