-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
83 lines (69 loc) · 2.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
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
plugins {
id 'org.springframework.boot' version '2.3.0.RELEASE'
id 'io.spring.dependency-management' version '1.0.9.RELEASE'
id 'java'
id 'com.palantir.docker' version '0.24.0'
id 'com.google.cloud.tools.jib' version '2.0.0'
}
ext {
mapstruct = '1.3.1.Final'
springfox = '2.9.2'
validation = '2.0.1.Final'
hibernateValidator = '6.1.2.Final';
}
group = 'com.example'
version = '1.0.1'
sourceCompatibility = '12'
configurations {
compileOnly {
extendsFrom annotationProcessor
}
}
repositories {
mavenCentral()
}
dependencies {
implementation 'org.springframework.boot:spring-boot-starter-data-jpa'
implementation 'org.springframework.boot:spring-boot-starter-thymeleaf'
implementation 'org.springframework.boot:spring-boot-starter-web'
implementation 'org.springframework.boot:spring-boot-starter-security'
compileOnly 'org.projectlombok:lombok'
developmentOnly 'org.springframework.boot:spring-boot-devtools'
runtimeOnly 'org.postgresql:postgresql'
annotationProcessor 'org.projectlombok:lombok'
testImplementation('org.springframework.boot:spring-boot-starter-test') {
exclude group: 'org.junit.vintage', module: 'junit-vintage-engine'
}
implementation "io.springfox:springfox-swagger2:${springfox}"
implementation "io.springfox:springfox-swagger-ui:${springfox}"
compile "javax.validation:validation-api:${validation}"
compile "org.hibernate.validator:hibernate-validator:${hibernateValidator}"
implementation "org.mapstruct:mapstruct:${mapstruct}"
annotationProcessor "org.mapstruct:mapstruct-processor:${mapstruct}"
}
test {
useJUnitPlatform()
}
task unpack(type: Copy) {
dependsOn bootJar
from(zipTree(tasks.bootJar.outputs.files.singleFile))
into("build/dependency")
}
docker {
name "${project.group}/${project.name}"
copySpec.from(tasks.unpack.outputs).into("dependency")
buildArgs(['DEPENDENCY': "dependency"])
}
jib {
container.creationTime="USE_CURRENT_TIMESTAMP"
from {
image = "adoptopenjdk/openjdk12:alpine-jre"
}
to {
image = "com.example/cinema"
tags = [getCheckedOutGitCommitHash().toString(), "latest"]
}
}
static def getCheckedOutGitCommitHash() {
'git rev-parse --verify HEAD'.execute().text.trim()
}