forked from chucknorris-io/chuck-api
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
93 lines (75 loc) · 2.72 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
plugins {
id 'com.palantir.docker' version '0.22.1'
id 'io.spring.dependency-management' version '1.0.8.RELEASE'
id 'java'
id 'org.springframework.boot' version '2.1.11.RELEASE'
}
def gitRev = { ->
def stdout = new ByteArrayOutputStream()
exec {
commandLine 'git', 'rev-parse', 'HEAD'
standardOutput = stdout
}
return stdout.toString().trim()
}
String appName = "api"
String appVer = gitRev()
group = "io.chucknorris"
version = appVer
java.sourceCompatibility = JavaVersion.VERSION_1_8
repositories {
mavenCentral()
}
// versions
def lombokVersion = "1.18.8"
dependencies {
annotationProcessor "org.projectlombok:lombok:${lombokVersion}"
implementation "com.amazonaws:aws-java-sdk:1.11.561"
implementation "com.fasterxml.jackson.core:jackson-core:2.9.9"
implementation "com.rometools:rome:1.12.0"
implementation "com.vladmihalcea:hibernate-types-52:2.4.0"
implementation "io.micrometer:micrometer-registry-prometheus:1.3.2"
implementation "io.springfox:springfox-swagger2:2.9.2"
implementation "nz.net.ultraq.thymeleaf:thymeleaf-layout-dialect:2.3.0"
implementation "org.hibernate:hibernate-validator:6.0.16.Final"
implementation "org.postgresql:postgresql:42.2.9"
implementation "org.projectlombok:lombok:${lombokVersion}"
implementation "org.springframework.boot:spring-boot-starter-actuator"
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"
testImplementation "org.springframework.boot:spring-boot-starter-test"
}
tasks {
bootJar {
manifest.attributes(
'Multi-Release': 'true'
)
archiveBaseName.set(appName)
archiveVersion.set(appVer)
if (project.hasProperty("archiveName")) {
archiveFileName.set(project.properties["archiveName"] as String)
}
}
docker {
dependsOn bootJar
def imageName = "${project.properties.group}/${appName}"
name = "${imageName}:latest"
tag("current", "${imageName}:${appVer}")
tag("latest", "${imageName}:latest")
tag("herokuProduction", "registry.heroku.com/chucky/web")
tag("herokuStaging", "registry.heroku.com/chucky-staging/web")
dockerfile file("${projectDir}/src/main/docker/Dockerfile")
files tasks.bootJar.outputs
buildArgs([JAR_FILE: bootJar.getArchiveFileName().get()])
}
springBoot {
buildInfo {
properties {
artifact = "${appName}-${appVer}.jar"
version = appVer
name = appName
}
}
}
}