-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
154 lines (117 loc) · 4.15 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
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
buildscript {
ext {
springBootVersion = '1.5.6.RELEASE'
}
repositories {
mavenCentral()
}
dependencies {
classpath("org.springframework.boot:spring-boot-gradle-plugin:${springBootVersion}")
}
}
apply plugin: 'java'
apply plugin: 'eclipse'
apply plugin: 'org.springframework.boot'
configurations.all {
resolutionStrategy.cacheChangingModulesFor 0, 'seconds'
}
version = '0.0.1'
group = 'com.github.RocketPartners'
repositories {
mavenLocal()
mavenCentral()
/* obtains the redshift jdbc driver */
maven { url "http://redshift-maven-repository.s3-website-us-east-1.amazonaws.com/release" }
maven { url 'https://jitpack.io' }
}
sourceCompatibility = 1.8
dependencies {
compile 'org.springframework.boot:spring-boot-starter-web'
compile 'org.springframework.boot:spring-boot-starter-actuator'
compile 'org.springframework.boot:spring-boot-starter-jdbc'
compile 'org.springframework.boot:spring-boot-starter-test'
compile 'net.rakugakibox.spring.boot:logback-access-spring-boot-starter:2.6.0'
compile group: 'mysql', name: 'mysql-connector-java', version: '5.1.34'
if (gradle.ext.liftck_snooze['addRocketSnoozeProjectToClasspath']) {
compile findProject(":rckt_snooze")
}
else {
compile("com.github.RocketPartners:rckt_snooze:release-0.3.x-SNAPSHOT") { changing = true }
}
}
/************************************************************
* Ensuring source directories are created if they do not
* already exist when running 'gradle eclipse'
*/
eclipse {
classpath {
file {
tasks.eclipse.dependsOn("create-dirs")
}
}
}
/************************************************************
* This task should be used when creating a new project as
* it will create all source and resource directories. This
* task is automatically executed during the
* 'gradle eclipse' command.
*/
task "create-dirs" {
doLast {
sourceSets*.java.srcDirs*.each { it.mkdirs() }
sourceSets*.resources.srcDirs*.each { it.mkdirs() }
}
}
/************************************************************
* This task is used to update the image tag name inside the
* taskdef.json file. The updated file is copied to the build dir.
* Usage: gradle updateTaskDefImageTagName -PimageTagName=someAwesomeTagNameGoesHere
*/
import org.apache.tools.ant.filters.ReplaceTokens
task updateTaskDefImageTagName() {
doLast {
if(project.hasProperty('taskDefFile')){
println "Using Task Def File: ${taskDefFile}"
}else{
throw new GradleException("\"taskDefFile\" property is required. ex: -PtaskDefFile=env/your-app-name-prod/taskdef.json")
}
copy {
from "${taskDefFile}"
into buildDir
println "Updating the image tag name in the taskdef.json file"
if(project.hasProperty('imageTagName')){
println "Using Image Tag Name: ${imageTagName}"
filter(ReplaceTokens, tokens: [IMAGE_TAG_NAME: imageTagName])
}else{
throw new GradleException("\"imageTagName\" property is required. ex: -PimageTagName=myImage")
}
}
}
}
task sendSlackMsg() {
doLast {
// blue #007dbc
// green #1e8900
// red #df3312
println "sendSlackMsg task is commented out, see the build.gradle file to enable. Doing nothing."
/*
if(project.hasProperty('slackTitle') && project.hasProperty('slackText')){
def color = "#007dbc"
if(project.hasProperty('slackColor')){
color = "${slackColor}"
}
def title = "${slackTitle}"
def text = "${slackText}"
String json = "{"
json += "\"color\":\"${color}\","
json += "\"title\":\"${title}\","
json += "\"fallback\":\"${title}\","
json += "\"text\":\"${text}\"}"
json = "{ \"attachments\": [" + json + "]}"
def curlResult = ['curl', '-X', 'POST', '-H', "Content-Type: application/json", 'https://hooks.slack.com/services/CHANGE-THIS-TO-YOUR-WEBHOOK', '-d', json].execute().text
}else{
throw new GradleException("\"slackTitle\" property and \"slackText\" property are required. ex: -PslackTitle=Building blah")
}
*/
}
}