This repository was archived by the owner on May 5, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathdiff.groovy
More file actions
55 lines (45 loc) · 1.61 KB
/
diff.groovy
File metadata and controls
55 lines (45 loc) · 1.61 KB
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
import com.urbancode.air.CommandHelper;
final def inputPropsFile = new File(args[0])
final def outputPropsFile = new File(args[1])
final def props = new Properties()
try {
props.load(new FileInputStream(inputPropsFile))
}
catch (IOException e) {
throw new RuntimeException(e)
}
final def cwd = new File('.');
final def cmdHelper = new CommandHelper(cwd);
//--------------------------------------------------------------------------------------------------
def getAbsPath(def file) {
def tempFile = null;
if (file != null && file != "") {
File temporaryFile = new File(file);
tempFile = temporaryFile.getAbsolutePath();
}
return tempFile;
}
//path properties
def daticalDBCmd = getAbsPath(props['daticalDBCmd']);
def daticalDBDriversDir = getAbsPath(props['daticalDBDriversDir']);
def daticalDBProjectDir = getAbsPath(props['daticalDBProjectDir']);
def daticalDBAction = "diff";
def daticalDBServerReference = props['daticalDBServerReference'];
def daticalDBServerComparison = props['daticalDBServerComparison'];
def cmdArgs = [daticalDBCmd, '-drivers', daticalDBDriversDir, '--project', daticalDBProjectDir, daticalDBAction, daticalDBServerReference, daticalDBServerComparison];
def daticalDBvm = props['daticalDBvm'];
if (daticalDBvm) {
cmdArgs << "--vm";
cmdArgs << daticalDBvm;
}
def daticalDBvmargs = props['daticalDBvmargs'];
if (daticalDBvmargs) {
cmdArgs << "--vmargs";
String[] myArray = daticalDBvmargs.split();
for ( x in myArray ) {
cmdArgs << x;
}
//cmdArgs << daticalDBvmargs;
}
int exitCode = cmdHelper.runCommand("Executing Datical DB", cmdArgs);
System.exit(exitCode);