Created
August 5, 2012 09:35
-
-
Save tamirko/3263405 to your computer and use it in GitHub Desktop.
change permissions example
This file contains hidden or 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 changes the permissions | |
of all the files inside the /usr/bin/myapp/data folder. | |
In this case, all the files in /usr/bin/myapp/data | |
will be writable after invoking this command. | |
*/ | |
builder = new AntBuilder() | |
builder.chmod(dir:"/usr/bin/myapp/data", perm:'+w', includes:"*") | |
/* Usage in Cloudify: | |
The following code snippet changes the permissions | |
of all the shell files in the service recipe folder. | |
In this case, all these *.sh files will be executable. | |
This code snippet also writes a (debug) message prior to invoking the chmod. | |
*/ | |
context = ServiceContextFactory.getServiceContext() | |
builder = new AntBuilder() | |
builder.sequential { | |
echo(message:"apacheLB_install.groovy: Chmodding +x ${context.serviceDirectory} ...") | |
chmod(dir:"${context.serviceDirectory}", perm:"+x", includes:"*.sh") | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Nice, thanks.