I think the reason that there's no answer is because this isn't generally
handled in capistrano tasks (capistrano itself needs the '-' flags, e.g. #
cap -T), and similarly, rake. environment variables are set prior to or
during capistrano execution, e.g. setting rails environment, ssl flag, and
server:
$ export SSL=true
$ cap deploy server=example.us

which can be read in capistrano tasks via this ENV hash: ENV['SSL'] and
ENV['server'], respectively.

there are a number of examples of accessing ENV from capistrano tasks:

http://snippets.dzone.com/tag/capistrano

hope that helps,
Erik


On Mon, Mar 30, 2009 at 9:08 PM, Stewart <
[email protected]> wrote:

>
> Hi,
>
> I am using cap to deploy a php based project. Works great so far. I am
> looking to add a command line param to my script so i can deploy to my
> staging or to live depending on what param I use.  So far i am trying
> to pass in commmand line args via "-s" from the console however cap
> does not seem to be reading the vars. when i do
>
>  Capistrano::Configuration.instance.load do |c|
>        p "option1 is #{c[:location]}" if c[:location]
>  end
>
> Any ideas on what i could be doing wrong?
>
> >
>

--~--~---------~--~----~------------~-------~--~----~
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at http://groups.google.com/group/capistrano
-~----------~----~----~----~------~----~------~--~---

Reply via email to