Automatically Unzip deployed Zip file


Ibrahim Elshal -


In some cases when you deploy a zip file you will need to unzip it automatically, this requires some customization to create new type that support doing this.




You can use any of below options,

 1. Package the content of the zip as a folder file.Folder type and when deployment done it will be unzipped on target system but this works only for .zip files not other archived extensions such as .tar

 2. You have is to Extend the functionality of XLDeploy by creating you own custom type, you can find more details about this in this link, below is an example of how you can do this.
Add the following type to XL_Deploy_Server_Home/ext/synthetic.xml

<type type="arch.DeployedZip" extends="generic.ExecutedScriptWithDerivedArtifact" deployable-type="arch.Zip"
<generate-deployable type="arch.Zip" extends="generic.File"/>
<property name="targetPath"/>
<property name="createScript" default="unzip_scripts/install-zip" hidden="true"/>
<property name="destroyScript" default="unzip_scripts/uninstall-zip" hidden="true"/>

Then create directory named unzip_scripts under XLDEPLOY_HOME/ext/ and put below 2 scripts file in it. with the following content:

unzip ${deployed.file} -d ${deployed.targetPath} with the following content:

rm -rf ${deployed.targetPath}

You will need then to restart XLDeploy server in order to reflect this new type.

Then in your application from repository you can define the zip as being of type arch.Zip.


By default if you deployed zip file it will not be unzipped.

Additional Information

This Example was for Linux you can do the same for Windows by changing scripts syntax to match that.


XLDeploy, Extentions