Take a look at this nginx recipe it has a pattern I commonly use to sed files 
in place 

https://github.com/donnoman/cap-recipes/blob/master/lib/cap_recipes/tasks/nginx/install.rb

Take a look specifically at the configure task and it's associated sets at the 
top of the namespace 

On Oct 8, 2012, at 5:37 PM, ellandir <[email protected]> wrote:

> Hi,
> 
> I am kind of new to Capistrano so not sure where the best resources for 
> recipes are (I've been though the official wiki pages though).
> 
> I am looking for a recipe to detokenize files within a given folder. Any idea 
> if that exists already (otherwise I'll create the script, just trying to not 
> reinvent the wheel)?
> 
> Let's say I have a source folder /src, with a bunch of files and subfolders.
> some of them will contain tokens like %PASSWORD%, or %DOMAIN%.
> I need the recipe to take an input 'properties file' like:
> PASSWORD=xyz
> DOMAIN=hellworld.com
> 
> and replace the tokens of all files in /src by the values specified in that 
> properties file; put the resulting files/folders in a folder /dest.
> 
> So in my example, if a file /src/db/testfile contained dbpassword=%PASSWORD%, 
> I should get a file /dest/db/testfile with dbpassword=xyz   (simple string 
> replacement)
> 
> 
> 
> 
> Laurent
> -- 
> * You received this message because you are subscribed to the Google Groups 
> "Capistrano" group.
> * To post to this group, send email to [email protected]
> * To unsubscribe from this group, send email to 
> [email protected] For more options, visit this group at 
> http://groups.google.com/group/capistrano?hl=en

-- 
* You received this message because you are subscribed to the Google Groups 
"Capistrano" group.
* To post to this group, send email to [email protected]
* To unsubscribe from this group, send email to 
[email protected] For more options, visit this group at 
http://groups.google.com/group/capistrano?hl=en

Reply via email to