-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
56 lines (50 loc) · 1.2 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
buildscript {
repositories {
mavenCentral()
maven {
url 'http://dl.bintray.com/vermeulen-mp/gradle-plugins'
}
}
dependencies {
classpath 'com.h2database:h2:1.4.191'
classpath 'mysql:mysql-connector-java:6.0.6'
}
}
task incrementVersion {
doLast {
def versionFile = new File("VERSION")
def versionTuple = versionFile.text.tokenize(".").collect({s -> s.toInteger()})
versionTuple[2] += 1
versionFile.text = versionTuple.join(".")
}
}
task build {
def version = new File("VERSION").text.trim()
doLast {
exec{
workingDir '.'
commandLine 'docker', 'build',
'--build-arg', "VERSION=${version}",
'-t', "bug-classifier:${version}", "."
}
exec{
workingDir '.'
commandLine 'docker', 'tag', "bug-classifier:${version}", 'bug-classifier:latest'
}
}
}
task run {
dependsOn = ["build"]
doFirst {
exec {
commandLine 'docker-compose', 'up', "-d"
}
}
}
task stop {
doFirst {
exec {
commandLine 'docker-compose', 'stop'
}
}
}