-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbuild.gradle
90 lines (70 loc) · 2.23 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
plugins {
id 'java'
id 'io.spring.dependency-management' version "1.0.9.RELEASE"
id 'org.springframework.boot' version '2.2.5.RELEASE'
id 'org.sonarqube' version '3.0'
id 'jacoco'
id 'pl.allegro.tech.build.axion-release' version '1.10.1'
id 'com.palantir.docker' version '0.25.0'
id 'com.palantir.docker-run' version '0.25.0'
id 'jp.classmethod.aws.cloudformation' version '0.41'
}
version = scmVersion.version
repositories {
mavenCentral()
jcenter()
}
dependencies {
implementation 'org.springframework.boot:spring-boot-starter-web'
implementation 'org.springframework.boot:spring-boot-starter-actuator'
implementation 'org.springframework.boot:spring-boot-starter-data-jpa'
implementation 'org.springframework.boot:spring-boot-devtools'
implementation group: 'com.h2database', name: 'h2', version: '1.3.148'
compileOnly 'org.projectlombok:lombok:1.18.12'
annotationProcessor 'org.projectlombok:lombok:1.18.12'
testImplementation 'org.springframework.boot:spring-boot-starter-test'
}
test {
useJUnitPlatform()
finalizedBy jacocoTestReport
}
jacocoTestReport {
dependsOn test
reports {
xml.enabled true
}
}
sonarqube {
properties {
property 'sonar.projectName', 'kudos-backend'
property 'sonar.host.url', 'http://ec2-3-235-176-239.compute-1.amazonaws.com:9000'
}
}
apply plugin: 'org.sonarqube'
String dockerHubUsernameProperty = findProperty('dockerHubUsername') ?: 'rthirumal1999'
String imageName = "rthirumal1999/kudos-backend:$version"
docker {
name imageName
files "build/libs/${bootJar.archiveFileName.get()}"
buildArgs([JAR_FILE: bootJar.archiveFileName.get()])
}
dockerRun {
name project.name
image imageName
ports '8080:8080'
clean true
}
import com.amazonaws.services.cloudformation.model.Capability
aws {
region = findProperty('region') ?: 'us-east-1'
}
cloudFormation {
stackName "kudos-backend-stack"
stackParams([
SubnetID: findProperty('subnetId') ?: 'subnet-378eaa09',
ServiceName: 'kudos-backend',
ServiceVersion: project.version,
DockerHubUsername: dockerHubUsernameProperty
])
templateFile project.file("ecs.yml")
}