-
Notifications
You must be signed in to change notification settings - Fork 13
/
hesperides.txt
executable file
·433 lines (391 loc) · 15.6 KB
/
hesperides.txt
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
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
<section>
<h2>Applications & platforms</h2>
<section>
<h2>hesperides.getAppInfo</h2>
Example:
<pre><code>
import static groovy.json.JsonOutput.*
echo prettyPrint(toJson(hesperides.getAppInfo(app: 'HJL')))
</code></pre>
</section>
<section>
<h2>hesperides.getPlatformInfo</h2>
Example:
<pre><code>
import static groovy.json.JsonOutput.*
echo prettyPrint(toJson(hesperides.getPlatformInfo(app: 'HJL', platform: 'USN1')))
</code></pre>
</section>
<section>
<h2>hesperides.createPlatform</h2>
Create a new application platform, with a 1st version, and optionally some modules
<br>
Example:
<pre><code>
hesperides.createPlatform app:'ABC' platform:'USN1' version:'1.0', isProduction:true,
fromApplication:'DEF', fromPlatform:'PRD2', copyPropertiesForUpgradedModules:false
hesperides.createPlatform app:'ABC' platform:'USN1' version:'0.0', modules: [
[
id: 0,
name: 'toto',
version: '0.0',
path: '#GROUP',
instances: [
[
name: 'TATA',
key_values: [
[
value: 'prop',
name: 42
]
]
]
],
propertiesPath: '#GROUP#toto#0.0#WORKINGCOPY',
working_copy: true
}
]
</code></pre>
</section>
<section>
<h2>hesperides.deletePlatform</h2>
Example:
<pre><code>
hesperides.deletePlatform(app: 'HJL', platform: 'USN1')
</code></pre>
</section>
<section>
<h2>hesperides.setPlatformVersion</h2>
Change a plateform version.
<br>
Example:
<pre><code>
hesperides.setPlatformVersion app:'HJL', platform:'USN2', checkCurrentVersion:'1-18-SNAPSHOT',
newVersion:'1.24-SNAPSHOT', copyPropertiesForUpgradedModules:false
</code></pre>
</section>
<section>
<h2>hesperides.cleanUnusedProperties</h2>
Clean all unused properties on a platform. You can specify a component path (optional)
<br>
Example:
<pre><code>
hesperides.cleanUnusedProperties app:'HJL', platform:'USN2', propertiesPath:'#HJLMODULE#JAR#hjlcomponent#1.0.0.0#RELEASE'
</code></pre>
</section>
</section>
<section>
<h2>Modules & deployed modules</h2>
<section>
<h2>hesperides.getModule</h2>
Example:
<pre><code>
import static groovy.json.JsonOutput.*
echo prettyPrint(toJson(hesperides.getModule(moduleName: 'toto', version: '1.0')))
</code></pre>
</section>
<section>
<h2>hesperides.doesModuleExist</h2>
Example:
<pre><code>
echo hesperides.doesModuleExist(moduleName: 'toto', version: '1.0', moduleType: 'workingcopy')
</code></pre>
</section>
<section>
<h2>hesperides.createModule</h2>
Example:
<pre><code>
hesperides.createModule(moduleName: 'toto', version: '1.0')
</code></pre>
</section>
<section>
<h2>hesperides.getModuleVersions</h2>
Retrieve the versions of a module.
<br>
Example:
<pre><code>
import static groovy.json.JsonOutput.*
echo prettyPrint(toJson(hesperides.getModuleVersions(moduleName: 'toto')))
</code></pre>
</section>
<section>
<h2>hesperides.releaseModule</h2>
Release one or several modules from their working copies.
<br>
Example:
<pre><code>
hesperides.releaseModule moduleName: 'toto', workingcopyVersion: '1.0-SNAPSHOT' releaseVersion: '1.0'
</code></pre>
</section>
<section>
<h2>hesperides.deleteModule</h2>
Example:
<pre><code>
hesperides.deleteModule version: 'toto', version: '1.0', moduleType: 'workingcopy'
</code></pre>
</section>
<section>
<h2>hesperides.putModuleOnPlatform</h2>
Example:
<pre><code>
hesperides.putModuleOnPlatform moduleName: 'toto', moduleVersion: '1.0', isWorkingCopy: true
app: 'HJL', platform:'USN2', logicGroupPath: '#HJL#WAS'
</code></pre>
</section>
<section>
<h2>hesperides.setPlatformModuleVersion</h2>
Change the version of one module on a plateform.
<br>
Example:
<pre><code>
hesperides.setPlatformModuleVersion app:'HJL', platform:'USN2', moduleName:'hjl-engine-api', checkCurrentVersion:'1-18-SNAPSHOT',
newVersion:'1.24-SNAPSHOT', isWorkingCopy: true, path: '#LOGIC#PATH',
copyPropertiesForUpgradedModules: false
</code></pre>
</section>
<section>
<h2>hesperides.setPlatformModulesVersion</h2>
Change the version of all modules on a plateform. Same parameters as <code>setPlatformModuleVersion</code> without the need for <code>moduleName</code>.
<br>
Example:
<pre><code>
hesperides.setPlatformModulesVersion app:'HJL', platform:'USN2', newVersion:'1.24-SNAPSHOT'
</code></pre>
</section>
</section>
<section>
<h2>Templates</h2>
<section>
<h2>hesperides.createTemplate</h2>
Create a new template on a given workingcopy module for a specific version.
<br>
Example:
<pre><code>
hesperides.createTemplate moduleName: 'toto', moduleVersion: '0.1.0',
location: '/appl/{{username}}/properties/application.yml', filename: 'application.yml', content: 'keycloakUrl: {{keycloak.url}}',
title: 'BaseSpringBootConfig', filePerms: [user: [read: true, write: true], group: [read: true], other: [read: true]]
</code></pre>
</section>
<section>
<h2>hesperides.deleteTemplate</h2>
Example:
<pre><code>
hesperides.deleteTemplate moduleName: 'toto', moduleVersion: '0.1.0', templateName: 'app.conf'
</code></pre>
</section>
<section>
<h2>hesperides.upsertTemplate</h2>
Upsert (create or update) a template on a given workingcopy module. Existing template for a module version is replaced.
<br>
Example:
<pre><code>
hesperides.upsertTemplate moduleName: 'corporate-client-aggregator', moduleVersion: '1.1.10',
location: '/appl/{{username}}/properties/application.yml', filename: 'application.yml', content: '{keycloakUrl: {{keycloak.url}}}',
title: 'BaseSpringBootConfig', filePerms: [user: [read: true, write: true], group: [read: true], other: [read: true]]
</code></pre>
</section>
<section>
<h2>hesperides.updateTemplate</h2>
Update a template on a given module for a specific version.
<br>
Example:
<pre><code>
hesperides.updateTemplate moduleName: 'toto', moduleVersion: '0.1.0',
location: '/appl/{{username}}/properties/application.yml', filename: 'application.yml', content: 'keycloakUrl: {{keycloak.url}}',
title: 'BaseSpringBootConfig', filePerms: [user: [read: true, write: true], group: [read: true], other: [read: true]]
</code></pre>
</section>
<section>
<h2>hesperides.upsertFromDescriptor</h2>
Upsert (create or update) one or several workingcopy module(s) and their templates from a file descriptor.
Any previously existing templates are deleted beforehand.
If 'title' field isn't set, the 'filename' is used instead.
<br>
Example jenkinsfile code :
<pre><code>
hesperides.upsertFromDescriptor descriptorPath: './hesperides-descriptor.json', moduleVersion: '1.1.10'
</code></pre>
Examble descriptor file :
<pre><code class="language-json">
{
"hjl-engine-api": {
"engine-api/src/main/resources-dev/template-application-prod.yml": {
"title": "application-prod.yml",
"filename": "application-prod.yml",
"location": "/appl/{{userwas}}/properties"
},
"engine-api/src/main/resources-dev/template-logback.properties": {
"title": "logback.properties",
"filename": "logback.properties",
"location": "/appl/{{userwas}}/properties"
}
},
"HJL-engine-core": {
"engine-core/src/main/resources-dev/template-application-core-prod.yml": {
"title": "application-core-prod.yml",
"filename": "application-core-prod.yml",
"location": "/appl/{{userwas}}/properties",
"filePerms": {"user": {"read": true, "write": true}, "group": {"read": true}, "other": {"read": true}}
}
}
}
</code></pre>
</section>
<section>
<h2>hesperides.getTemplates</h2>
Example:
<pre><code>
import static groovy.json.JsonOutput.*
echo prettyPrint(toJson(hesperides.getTemplates(moduleName: 'toto', version: '1.0', moduleType: 'workingcopy')))
</code></pre>
</section>
<section>
<h2>hesperides.getTemplate</h2>
Example:
<pre><code>
import static groovy.json.JsonOutput.*
echo prettyPrint(toJson(hesperides.getTemplate(moduleName: 'toto', version: '1.0', moduleType: 'workingcopy', filename: 'app.conf')))
</code></pre>
</section>
<section>
<h2>hesperides.getModulePropertiesForPlatform</h2>
Example:
<pre><code>
import static groovy.json.JsonOutput.*
echo prettyPrint(toJson(hesperides.getModuleTemplateProperties(moduleName: 'toto', version: '1.0', moduleType: 'workingcopy')))
</code></pre>
</section>
</section>
<section>
<h2>Properties</h2>
<section>
<h2>hesperides.getModulePropertiesForPlatform</h2>
Example:
<pre><code>
import static groovy.json.JsonOutput.*
echo prettyPrint(toJson(hesperides.getModulePropertiesForPlatform(app: 'HJL', platform: 'USN1', modulePropertiesPath: '#HJL#WAS#toto#1.0#WORKINGCOPY')))
</code></pre>
</section>
<section>
<h2>hesperides.updateProperties</h2>
Change instance/module/global properties on a given Hesperides platform, from a JSON file listing deltas.
Existing properties are not altered. The properties can also be defined by their path.
<br>
Example JSON deltas file:
<pre><code class="language-json">
{
"hjl-engine-api": {
"api_log_level": "DEBUG",
"engine.config.products_types": "HOTEL,ARTICLE,IDAVIS,VOITURE,IDCAB,OUICAR",
"iterable_properties": {
"clients.configuration": [
{
"clientId": "new_home-MonVoyage",
"authorizedProducts": "\"ARTICLE\", \"IDCAB\""
}
]
}
},
"another-module#INSTANCE_NAME": {},
"another-third-module": {
"polymorphistic_property": "a default value on the platform"
},
"path:#anotherLogicGroup#another-third-module": {
"polymorphistic_property": "an overriden value for a specific path"
},
"GLOBAL": {}
}
</code></pre>
<br>
Example:
<pre><code>
hesperides.updateProperties app: 'HJL', platform: 'USN1', jsonPropertyUpdates: "$env.WORKSPACE/hesperides_changes/HJL-USN1.json", commitMsg: 'Test'
</code></pre>
</section>
<section>
<h2>hesperides.updatePropertiesForPlatform</h2>
Update properties for given module path.
Usually, before using this method, retrieve properties to update with getModulePropertiesForPlatform(...) and properties_path from chosen module
<br>
Example:
<pre><code>
hesperides.updatePropertiesForPlatform(app: 'APP', platform: 'PTF',
modulePropertiesPath: '#APP#PTF#module#1.0#WORKINGCOPY', commitMsg: 'MyCommitMsg',
properties: myJsonPropertiesRetreivedFromGetAPI, platformVid: platformVid, auth: auth)
</code></pre>
</section>
<section>
<h2>hesperides.getDiffProperties</h2>
Allow the comparison of properties between one platform or module with itself (minus 2 hours) or between 2 platforms or 2 modules. This uses the REST API /properties/diff
<br>
<b>NB :</b> The optional <code>timestampDate</code> parameter must be of type <code>long</code> or <code>Date</code>.
<br>
Example:
<pre><code>
hesperides.getDiffProperties(app: 'APP',
platform: 'PTF',
modulePropertiesPath: '#APP#PTF#module#1.0#WORKINGCOPY',
toApplication: APP2,
toPlatform: PTF2,
toModulePropertiesPath: '#APP#PTF2#module#1.0#WORKINGCOPY')
</code></pre>
</section>
<section>
<h2>hesperides.getDiffPropertiesAsString</h2>
Build a text representation of the output of <a href="#hesperides.getDiffProperties"><code>getDiffProperties</code></a> as a 2 columns table
showing the differences of properties values between 2 platforms or deployed modules.
<br>
Example:
<pre><code>
// Diff. between 2 versions of a same module at a different timestamp
hesperides.getDiffPropertiesAsString(
app: 'APP',
platform: 'PTF',
modulePropertiesPath: '#APP#PTF#module#1.0#WORKINGCOPY',
diffType: 'differing')
OR
// Diff. between 2 versions of a same module on 2 differents platforms
hesperides.getDiffPropertiesAsString(
app: 'APP',
platform: 'PTF',
modulePropertiesPath: '#APP#PTF#module#1.0#WORKINGCOPY',
toApplication: APP2,
toPlatform: PTF2,
toModulePropertiesPath: '#APP#PTF2#module#1.0#WORKINGCOPY',
diffType: 'differing')
</code></pre>
</section>
</section>
<section>
<h2>Instances</h2>
<section>
<h2>hesperides.getInstanceProperties</h2>
Example:
<pre><code>
import static groovy.json.JsonOutput.*
echo prettyPrint(toJson(hesperides.getInstanceProperties(app: 'APP', platform: 'PTF', moduleName: 'toto', instance: 'APPPTFI1')))
</code></pre>
</section>
<section>
<h2>hesperides.createInstance</h2>
Example:
<pre><code>
hesperides.createInstance(app: 'APP', platform: 'PTF', moduleName: 'toto', instance: 'APPPTFI1')
</code></pre>
</section>
<section>
<h2>hesperides.deleteInstance</h2>
Example:
<pre><code>
hesperides.deleteInstance(app: 'APP', platform: 'PTF', moduleName: 'toto', instance: 'APPPTFI1')
</code></pre>
</section>
<section>
<h2>hesperides.getInstanceFiles</h2>
Example:
<pre><code>
import static groovy.json.JsonOutput.*
echo prettyPrint(toJson(hesperides.getInstanceFiles(app: 'APP', platform: 'PTF', moduleName: 'toto', instance: 'APPPTFI1')))
</code></pre>
</section>
</section>