Use 'capture' with a find bash command Then you can use the variable in your if
On Apr 3, 2012, at 11:11 AM, Saurav Shah <[email protected]> wrote: > Snippets from my deploy.rb > > task :prod1 do > set :deploy_to, "/home/project/src/prod1" > end > > task :prod2 do > set :deploy_to, "/home/project/src/prod2" > end > I have 2 tasks like the above. Now instead of manually running either "cap > prod1 deploy" or "cap prod2 deploy", I want to create a task "prod" which > sets the required "deploy_to" based on the existence of a file on the server. > > something like: > > task :prod do > if (A_FILE_IN_SERVER_EXISTS) > set :deploy_to, "/home/project/src/prod2" > else > set :deploy_to, "/home/project/src/prod1" > end > How do I do that? > > > > Stackoverflow link: > http://stackoverflow.com/questions/9996574/how-to-set-conditional-variables-in-capistranos-deploy-rb > > -- > * 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
