-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
86 lines (61 loc) · 2.13 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
apply plugin: 'pl.allegro.tech.build.axion-release'
project.ext.set("glueVersion", "1.1.107")
project.version = scmVersion.version
repositories {
mavenLocal()
}
configurations {
gluetoolsCore
}
dependencies {
gluetoolsCore group: 'cvr.ac.uk', name: 'gluetools-core', version: project.glueVersion, transitive: false
}
buildscript {
repositories {
// for ssh-deploy stuff
jcenter()
// for axion-release
mavenCentral()
}
dependencies {
classpath group: 'commons-io', name: 'commons-io', version: '1.3.2'
classpath group: 'pl.allegro.tech.build', name: 'axion-release-plugin', version: '1.9.3'
}
}
task copyGluetoolsJar(type: Copy) {
from configurations.gluetoolsCore
into "$buildDir/runtimeJars"
rename('gluetools-core-'+project.glueVersion+'.jar', 'gluetools-core.jar')
}
def glueConfigFile = 'remote-gluetools-config.xml'
task wipeRabvGlueDB(type: Exec) {
commandLine "bash", "-c", "echo 'DROP DATABASE IF EXISTS RABV_GLUE; create database RABV_GLUE character set UTF8;' | mysql -u rabvglue --password=rabvglue"
}
task buildRabvGlueDB(type: JavaExec, dependsOn: 'copyGluetoolsJar') {
classpath "build/runtimeJars/gluetools-core.jar"
main 'uk.ac.gla.cvr.gluetools.core.console.Console'
args '-c', glueConfigFile, '-i', 'run', 'file', 'rabvProject.glue'
}
task dumpRabvGlueDB(type: Exec, dependsOn: 'buildRabvGlueDB') {
standardOutput = new FileOutputStream(new File('/tmp/rabv_glue.sql'))
commandLine '/usr/local/mysql/bin/mysqldump', '-u', 'rabvglue', '--password=rabvglue', 'RABV_GLUE'
}
task zipRabvGlueDB(type: Exec, dependsOn: 'dumpRabvGlueDB') {
commandLine '/usr/bin/gzip', '-f', '/tmp/rabv_glue.sql'
}
def scmCustomKey = '/Users/imacadmin/.ssh/github_id_rsa'
scmVersion {
hooks {
pre 'fileUpdate', [file: 'glue/rabvProjectSettings.glue', pattern: {v, c -> /set setting project-version $v/}, replacement: {v, c -> "set setting project-version $v"}]
pre 'commit', {v, p -> "Release version $v"}
}
scmVersion {
versionCreator 'versionWithBranch'
repository {
customKey = file(scmCustomKey)
}
tag {
prefix = 'RABV-GLUE'
}
}
}