Skip to content

Commit 0214d25

Browse files
author
Pete Pickerill
authored
Merge pull request #3 from IBM-UrbanCode/BM-1165
Update Datical UC plug in to support Datical 5 & Immutable Project Deployment Workflows
2 parents 31e8308 + b0589e8 commit 0214d25

10 files changed

Lines changed: 381 additions & 106 deletions

File tree

.travis.yml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,13 @@ rvm:
44
install:
55
- ant install-ivy -DfailIvy=false
66
before_script:
7-
- export BUILD_LIFE=${TRAVIS_TAG}
7+
- export BUILD_LIFE=${TRAVIS_COMMIT:0:7}
88
- ant run-tests
99
script:
1010
- ant -DbuildLife=${BUILD_LIFE}
1111
jdk:
1212
- oraclejdk8
13-
- oraclejdk7
1413
- openjdk7
15-
- openjdk6
1614
notifications:
1715
slack:
1816
secure: IHx7lyduKZq2euHqoNtARinzdNMVHPwMZ74jAf48c2a4dqu/aJfEvbJ9VNN2A+xLnNwf7wK46TNBtRIRbJZBeOFMf+aRZnHSRJFAWFXAg37uezeL6oN0KHo0CUl0Wib9hvyiM3pVzs0ZQ4qdxelwEhDn4CLulfo/haV0OFVoNeN3ldfs8VwXENU4+K1quxgDMz4XTd5mHjssaLcSLvDlbM3E+yoam/rRVl6w+LD2NkxyszZRloOMn9wcAVhadA47kv5/TmTL8ONz67efSLxN6vbPx7CQuWMV050NcUCczZNxDxom7bXp4+i19thjCUO08BR9nVprExiGNXk16msslsGpG2ietNUeMUbLq2hA5ih6OVgqOEZhHiO/7L7zYXuhNkN7fTcW/MR8On1W+jzBhVpUjdQ9LDiRA+yS9JXvgbvoAYd5b22C3BZqpzVVxOhK/Uq1ekDhIfGk7uVuSVtkqk0NLkDrmfc7AReMCQbJEAlEgI8kBZBamKDYFamzLY2NMiF2KZnVOBazmK6/y+rafqwnp5hQ77B7wa3Gb0pjIXeLwljfUQWxayZNWJhOpOYJUJ+2OIRRCMKNDuk9/7TMPZrv6mBIDkJR/2Rr/FhIZCCQjU2fO43gBGzAIL2tI7Mqnc+b3nsyvEQ5SGFLXrBhnYu9k9g4tpD2aZveeBwdF58=

README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,14 @@ This plug-in is protected under the [Apache 2.0 License](https://www.apache.org/
2020

2121
Release Notes:
2222

23+
### Version 25 - May 2, 2018
24+
25+
Added Support for Datical 5 Command Parameters and the immutableProject flag for artifact based Deployments
26+
27+
### Version 24 - October 20, 2017
28+
29+
Added Support for Runtime Credentials in Forecast, Deploy, Status, and Status Details steps
30+
2331
### Version 23 - September 27, 2017
2432

2533
Added Pipeline parameter to Deploy Command

plugin/info.xml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,16 @@
5252
<release-note plugin-version="22.223">
5353
Community GitHub Release
5454
</release-note>
55+
<release-note plugin-version="23">
56+
Added Pipeline parameter to Deploy Command
57+
</release-note>
58+
<release-note plugin-version="24">
59+
Added Support for Runtime Credentials in Forecast, Deploy, Status and Status Details steps
60+
</release-note>
61+
<release-note plugin-version="25">
62+
Added Pipeline Parameter to Status, Status Details and Forecast Commands
63+
Added Support for Datical 5 Server Parameters to Forecast, Deploy, Status, and Status Details Commands
64+
</release-note>
5565
</release-notes>
5666

5767
</pluginInfo>

plugin/plugin.xml

Lines changed: 111 additions & 33 deletions
Large diffs are not rendered by default.

plugin/upgrade.xml

Lines changed: 51 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,26 @@
22
<plugin-upgrade xmlns="http://www.urbancode.com/UpgradeXMLSchema_v1"
33
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
44

5+
<migrate to-version="25">
6+
7+
<migrate-command name="Deploy with Datical DB">
8+
<migrate-properties>
9+
<migrate-property name="daticalServiceUsername"/>
10+
<migrate-property name="daticalService"/>
11+
</migrate-properties>
12+
</migrate-command>
13+
14+
</migrate>
15+
16+
<migrate to-version="23">
17+
18+
<migrate-command name="Deploy with Datical DB">
19+
<migrate-properties>
20+
<migrate-property name="daticalDBPipeline"/>
21+
</migrate-properties>
22+
</migrate-command>
23+
24+
</migrate>
525

626
<migrate to-version="23">
727

@@ -33,7 +53,7 @@
3353
</migrate>
3454

3555
<migrate to-version="22">
36-
56+
3757
<migrate-command name="Run Groovy Script"/>
3858
<migrate-command name="Register and Baseline Datical DB Project"/>
3959
<migrate-command name="Create Datical DB Project"/>
@@ -54,11 +74,11 @@
5474
<migrate-command name="Add Datical DB Project"/>
5575
<migrate-command name="Add Datical DB Database Definition"/>
5676
<migrate-command name="Datical DB Install License"/>
57-
77+
5878
</migrate>
5979

6080
<migrate to-version="21">
61-
81+
6282
<migrate-command name="Run Groovy Script"/>
6383
<migrate-command name="Register and Baseline Datical DB Project"/>
6484
<migrate-command name="Create Datical DB Project"/>
@@ -79,12 +99,12 @@
7999
<migrate-command name="Add Datical DB Project"/>
80100
<migrate-command name="Add Datical DB Database Definition"/>
81101
<migrate-command name="Datical DB Install License"/>
82-
102+
83103
</migrate>
84104

85105

86106
<migrate to-version="20">
87-
107+
88108
<migrate-command name="Register and Baseline Datical DB Project"/>
89109
<migrate-command name="Create Datical DB Project"/>
90110
<migrate-command name="Get Datical DB Version"/>
@@ -104,11 +124,11 @@
104124
<migrate-command name="Add Datical DB Project"/>
105125
<migrate-command name="Add Datical DB Database Definition"/>
106126
<migrate-command name="Datical DB Install License"/>
107-
127+
108128
</migrate>
109129

110130
<migrate to-version="19">
111-
131+
112132
<migrate-command name="Register and Baseline Datical DB Project"/>
113133
<migrate-command name="Create Datical DB Project"/>
114134
<migrate-command name="Get Datical DB Version"/>
@@ -128,11 +148,11 @@
128148
<migrate-command name="Add Datical DB Project"/>
129149
<migrate-command name="Add Datical DB Database Definition"/>
130150
<migrate-command name="Datical DB Install License"/>
131-
151+
132152
</migrate>
133-
153+
134154
<migrate to-version="18">
135-
155+
136156
<migrate-command name="Register and Baseline Datical DB Project"/>
137157
<migrate-command name="Create Datical DB Project"/>
138158
<migrate-command name="Get Datical DB Version"/>
@@ -152,11 +172,11 @@
152172
<migrate-command name="Add Datical DB Project"/>
153173
<migrate-command name="Add Datical DB Database Definition"/>
154174
<migrate-command name="Datical DB Install License"/>
155-
175+
156176
</migrate>
157-
177+
158178
<migrate to-version="17">
159-
179+
160180
<migrate-command name="Register and Baseline Datical DB Project"/>
161181
<migrate-command name="Create Datical DB Project"/>
162182
<migrate-command name="Get Datical DB Version"/>
@@ -176,11 +196,11 @@
176196
<migrate-command name="Add Datical DB Project"/>
177197
<migrate-command name="Add Datical DB Database Definition"/>
178198
<migrate-command name="Datical DB Install License"/>
179-
199+
180200
</migrate>
181-
201+
182202
<migrate to-version="16">
183-
203+
184204
<migrate-command name="Create Datical DB Project"/>
185205
<migrate-command name="Get Datical DB Version"/>
186206
<migrate-command name="Deploy with Datical DB"/>
@@ -199,11 +219,11 @@
199219
<migrate-command name="Add Datical DB Project"/>
200220
<migrate-command name="Add Datical DB Database Definition"/>
201221
<migrate-command name="Datical DB Install License"/>
202-
222+
203223
</migrate>
204-
224+
205225
<migrate to-version="15">
206-
226+
207227
<migrate-command name="Get Datical DB Version"/>
208228
<migrate-command name="Deploy with Datical DB"/>
209229
<migrate-command name="Validate and Forecast with Datical DB" old="Forecast with Datical DB"/>
@@ -221,11 +241,11 @@
221241
<migrate-command name="Add Datical DB Project"/>
222242
<migrate-command name="Add Datical DB Database Definition"/>
223243
<migrate-command name="Datical DB Install License"/>
224-
244+
225245
</migrate>
226-
246+
227247
<migrate to-version="14">
228-
248+
229249
<migrate-command name="Get Datical DB Version" old="Datical DB Version"/>
230250
<migrate-command name="Deploy with Datical DB" old="Datical DB Deploy"/>
231251
<migrate-command name="Forecast with Datical DB" old="Datical DB Forecast"/>
@@ -243,12 +263,12 @@
243263
<migrate-command name="Add Datical DB Project" old="Datical DB Create New Project"/>
244264
<migrate-command name="Add Datical DB Database Definition" old="Datical DB Create New Database Definition"/>
245265
<migrate-command name="Datical DB Install License"/>
246-
266+
247267
</migrate>
248-
268+
249269
<migrate to-version="13">
250-
251-
270+
271+
252272
<migrate-command name="Add add"/>
253273
<migrate-command name="Allocate allocate"/>
254274
<migrate-command name="AppCmd shellArgs"/>
@@ -373,7 +393,7 @@
373393
<migrate-command name="Datical DB Create New Database Definition" />
374394
<migrate-command name="Datical DB Install License" />
375395
</migrate>
376-
396+
377397
<migrate to-version="9">
378398
<migrate-command name="Datical DB Deploy" />
379399
<migrate-command name="Datical DB Forecast" />
@@ -392,7 +412,7 @@
392412
<migrate-command name="Datical DB Create New Database Definition" />
393413
<migrate-command name="Datical DB Install License" />
394414
</migrate>
395-
415+
396416
<migrate to-version="8">
397417
<migrate-command name="Datical DB Deploy" />
398418
<migrate-command name="Datical DB Forecast" />
@@ -609,7 +629,7 @@
609629
<migrate-command name="Datical DB Create New Database Definition" />
610630
<migrate-command name="Datical DB Install License" />
611631
</migrate>
612-
632+
613633
<migrate to-version="2">
614634
<migrate-command name="Datical DB Deploy">
615635
<migrate-properties>
@@ -653,5 +673,5 @@
653673
<migrate-command name="Datical DB Create New Database Definition" />
654674
<migrate-command name="Datical DB Install License" />
655675
</migrate>
656-
657-
</plugin-upgrade>
676+
677+
</plugin-upgrade>

src/main/scripts/deploy.groovy

Lines changed: 43 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,6 @@ catch (IOException e) {
1414
final def cwd = new File('.');
1515
final def cmdHelper = new CommandHelper(cwd);
1616

17-
18-
1917
//--------------------------------------------------------------------------------------------------
2018
def getAbsPath(def file) {
2119
def tempFile = null;
@@ -27,16 +25,22 @@ def getAbsPath(def file) {
2725
}
2826
//path properties
2927
def daticalDBCmd = getAbsPath(props['daticalDBCmd']);
28+
def daticalDBUsername = props['daticalDBUsername'];
29+
def daticalDBPassword = props['daticalDBPassword'];
3030
def daticalDBDriversDir = getAbsPath(props['daticalDBDriversDir']);
3131
def daticalDBPipeline = props['daticalDBPipeline'];
3232
def daticalDBProjectDir = getAbsPath(props['daticalDBProjectDir']);
33+
def daticalImmutableProject = props['daticalImmutableProject'];
34+
def daticalProjectName = props['daticalProjectName'];
3335
def daticalDBAction = "deploy";
3436
def daticalDBServer = props['daticalDBServer'];
3537
def daticalDBContext = props['daticalDBContext'];
3638
def daticalDBRollback = props['daticalDBRollback']
3739
def daticalDBExportSQL = props['daticalDBExportSQL'];
3840
def daticalDBExportRollbackSQL = props['daticalDBExportRollbackSQL'];
3941
def daticalDBLabels = props['daticalDBLabels'];
42+
def daticalServiceUsername = props['daticalServiceUsername'];
43+
def daticalService = props['daticalService'];
4044

4145

4246
if (daticalDBRollback == "false") {
@@ -45,28 +49,49 @@ if (daticalDBRollback == "false") {
4549
daticalDBAction = "deploy-autoRollback";
4650
}
4751

48-
def cmdArgs = "";
52+
// START building the CLI args. Start with the pointer to hammer
53+
def cmdArgs = [daticalDBCmd];
4954

50-
if (daticalDBExportSQL == "true") {
51-
52-
if (daticalDBExportRollbackSQL == "true") {
53-
54-
cmdArgs = [daticalDBCmd, '-drivers', daticalDBDriversDir, '--project', daticalDBProjectDir, "--genSQL", "--genRollbackSQL"];
55-
56-
} else {
57-
58-
cmdArgs = [daticalDBCmd, '-drivers', daticalDBDriversDir, '--project', daticalDBProjectDir, "--genSQL"];
55+
//Check for Datical Service Specific Properties nd BUild the Appropriate Command Line
56+
if (daticalService && daticalServiceUsername) {
57+
cmdArgs << "--daticalServer=" + daticalService;
58+
cmdArgs << "--daticalUsername=" + daticalServiceUsername;
59+
}
5960

60-
}
61-
62-
} else if (daticalDBExportRollbackSQL == "true") {
61+
// Set the immutableProject flag if needed
62+
if (daticalImmutableProject) {
63+
cmdArgs << "--immutableProject=" + daticalImmutableProject;
64+
}
6365

64-
cmdArgs = [daticalDBCmd, '-drivers', daticalDBDriversDir, '--project', daticalDBProjectDir, "--genRollbackSQL"];
66+
if (daticalProjectName){
67+
cmdArgs << "--projectKey=" + daticalProjectName;
68+
}
6569

66-
} else {
70+
// Add driver location and project directory
71+
cmdArgs << '--drivers';
72+
cmdArgs << daticalDBDriversDir;
73+
cmdArgs << '--project';
74+
cmdArgs << daticalDBProjectDir;
75+
76+
// Handle SQL Exports
77+
if (daticalDBExportSQL == "true") {
78+
cmdArgs << '--genSQL';
79+
}
80+
81+
if (daticalDBExportRollbackSQL == "true") {
82+
cmdArgs << '--genRollbackSQL';
83+
}
6784

68-
cmdArgs = [daticalDBCmd, '-drivers', daticalDBDriversDir, '--project', daticalDBProjectDir];
85+
if (daticalDBUsername) {
86+
def usernameString = daticalDBContext + ":::" + daticalDBUsername;
87+
cmdArgs << "-un";
88+
cmdArgs << usernameString;
89+
}
6990

91+
if (daticalDBPassword) {
92+
def passwordString = daticalDBContext + ":::" + daticalDBPassword;
93+
cmdArgs << "-pw";
94+
cmdArgs << passwordString;
7095
}
7196

7297
if (daticalDBContext) {

src/main/scripts/diffchangelog.groovy

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ if (daticalDBChangeLog) {
4141
cmdArgs = [daticalDBCmd, '-drivers', daticalDBDriversDir, '--project', daticalDBProjectDir,daticalDBAction, daticalDBServerReference, daticalDBServerComparison, daticalDBChangeLog];
4242
} else {
4343
cmdArgs = [daticalDBCmd, '-drivers', daticalDBDriversDir, '--project', daticalDBProjectDir,daticalDBAction, daticalDBServerReference, daticalDBServerComparison];
44-
}
44+
}
4545

4646
def daticalDBLabels = props['daticalDBLabels'];
4747
if (daticalDBLabels) {

0 commit comments

Comments
 (0)