Created
August 2, 2012 14:07
-
-
Save tamirko/3237336 to your computer and use it in GitHub Desktop.
unzip with ant in groovy
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Groovy Usage: | |
This code snippet unzips /tmp/stuff/myFile.zip to the /opt/apps folder. | |
Any file/folder inside myFile.zip which already exists in /opt/apps folder, | |
will NOT be overriden. | |
*/ | |
builder = new AntBuilder() | |
builder.unzip(src:"/tmp/stuff/myFile.zip", dest:"/opt/apps", overwrite:false) | |
/* Usage in Cloudify: | |
The following code snippet unzips(untars) the /home/user/data/myfile.tgz file | |
to the /home/user folder. | |
Any file/folder inside myTarfile.tgz that already exists in the destination folder, | |
will be overridden. | |
In this case, the compression method that was used to create | |
this zipped file is "gzip'. | |
*/ | |
installDir = "/home/user" | |
builder = new AntBuilder() | |
builder.untar(src:"${installDir}/data/myTarfile.tgz", dest:"${installDir}", compression:"gzip", overwrite:true) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment