-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
51 lines (40 loc) · 1.35 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
group 'com.oreilly'
apply plugin: 'java'
apply plugin: 'docker'
apply plugin: 'application'
buildscript {
repositories { jcenter() }
dependencies {
classpath 'se.transmode.gradle:gradle-docker:1.2'
}
}
repositories {
mavenCentral()
maven {
url 'http://dl.bintray.com/rickfast/microservice-chassis/'
}
}
dependencies {
compile 'com.oreilly.microservices:microservice-chassis:1.0'
compile 'org.jsr107.ri:cache-annotations-ri-guice:1.0.0'
compile 'org.ehcache:jcache:1.0.0'
}
mainClassName = 'com.oreilly.weather.WeatherService'
task dockerImage(type: Docker) {
group = 'docker'
description = "Packs the project's JVM application as a Docker image."
inputs.files project.distTar
push = Boolean.getBoolean('docker.push')
doFirst {
def buildNumber = System.getenv('BUILD_NUMBER')
baseImage = 'rickfast/oreilly-microservice-base'
tagVersion = buildNumber ? "${project.version}.${buildNumber}" : project.version
registry = 'docker4tracy'
applicationName = project.applicationName
addFile project.distTar.outputs.files.singleFile
exposePort 8080
def installDir = "/" + project.distTar.archiveName - ".${project.distTar.extension}"
entryPoint = ["$installDir/bin/${project.applicationName}"]
}
}
dockerImage.dependsOn 'assemble'