-
Notifications
You must be signed in to change notification settings - Fork 12
/
Copy pathbuild.gradle
56 lines (46 loc) · 1.22 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
apply plugin: 'java'
apply plugin: 'application'
apply plugin: 'docker'
buildscript {
repositories { jcenter() }
dependencies {
classpath('se.transmode.gradle:gradle-docker:1.2')
}
}
repositories {
mavenCentral()
}
dependencies {
compile 'com.codahale.metrics:metrics-core:3.0.1'
compile 'com.codahale.metrics:metrics-graphite:3.0.2'
compile 'org.slf4j:slf4j-api:1.7.13'
compile 'org.slf4j:slf4j-simple:1.7.13'
}
version = '0.1'
sourceCompatibility = 1.8
targetCompatibility = 1.8
mainClassName = "com.graphite.stress.Stresser"
//create a single Jar with all dependencies
task uberjar(type: Jar) {
manifest {
attributes 'Implementation-Version': version,
'Main-Class': mainClassName
}
baseName = project.name
from { configurations.compile.collect { it.isDirectory() ? it : zipTree(it) } }
with jar
}
group = "banno"
docker {
baseImage "java:8-jre"
}
task buildDocker(type: Docker, dependsOn: 'uberjar') {
doFirst {
copy {
from uberjar
into stageDir
}
}
addFile("graphite-stresser-0.1.jar", "/opt/graphite-stresser/")
entryPoint(["java", "-jar", "/opt/graphite-stresser/graphite-stresser-0.1.jar"])
}