-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathbuild.gradle
40 lines (33 loc) · 1.28 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
plugins {
id 'org.springframework.boot' version '1.5.10.RELEASE'
id 'com.garyclayburg.dockerprepare' version '1.3.1'
id "com.bmuschko.docker-remote-api" version "3.1.0"
id 'java'
id 'eclipse'
}
version = '0.0.1-SNAPSHOT'
sourceCompatibility = 1.8
repositories {
mavenCentral()
}
dockerprepare {
commonService = ['org.springframework.boot:spring-boot-starter-web']
}
dependencies {
compile('org.springframework.boot:spring-boot-starter-web')
testCompile('org.springframework.boot:spring-boot-starter-test')
}
def dockerImageName = 'myorg/' + project.name
task buildImage(type: com.bmuschko.gradle.docker.tasks.image.DockerBuildImage, dependsOn: 'dockerLayerPrepare') {
description = "build and tag a Docker Image"
inputDir = project.file(dockerprepare.dockerBuildDirectory)
tags = [dockerImageName + ':latest', dockerImageName + ':' + version]
}
task pushVersion(type: com.bmuschko.gradle.docker.tasks.image.DockerPushImage, dependsOn: buildImage) {
description = "docker push <imageName>:<version>"
imageName = dockerImageName + ":" + version
}
task pushLatest(type: com.bmuschko.gradle.docker.tasks.image.DockerPushImage, dependsOn: buildImage) {
description = "docker push <imageName>:latest"
imageName = dockerImageName + ":latest"
}