Wednesday, October 24, 2018

Importing and exporting dictionaries in XL-Deploy

XebiaLab XL-Deploy is a great tool, but definitely lacking important features as far as versioning and exporting/importing configuration.

If you need to programmatically generate a Dictionary (rather than using the painfully limited UI), you can take a look at this code https://github.com/xebialabs-community/xld-aws-ecs-plugin/blob/master/src/test/resources/docker/initialize/exportCIs.py


In my case, I create a dictionary "pippo.dict" with a couple of keys (pippo, paperino...)

then from the cli:

mypippo=repository.searchByName('pippo.dict')
print mypippo
['Environments/pippo/pippo.dict']

repository.exportCisAndWait('Environments/pippo/pippo.dict')
export/pippo.dict_2018-10-24_16-36-45_045.zip



then

cd /home/centos/xldeploy/xl-deploy-8.2.0-server/export
unzip pippo.dict_2018-10-24_16-36-45_045.zip
cat configuration-items.xml


there are several entries <entry key="pippo">pluto</entry>

you can add/delete/edit those entries, then create a new file (with a slightly different name, 56 instead of 36):

zip pippo.dict_2018-10-24_16-56-45_045.zip configuration-items.xml

and in the CLI:

repository.importCisAndWait('export/pippo.dict_2018-10-24_16-56-45_045.zip')

and lo and behold, the updated properties are in the dictionary!







No comments: