cap upload dir_a dir_b dir_c
I know that the capistrano multistage extension reads several items
from the command line, so it should be possible.
If i just execute the above as is, I get a "task dir_a not
found" (although I can still use the arguments with ARGV[]).
TIA,
-Adam
If you want to pass parameters to your tasks, you can do it via
environment variables:
cap upload FILES=dir_a,dir_b,dir_c
Then, your upload task gets the FILES env var, parses it, and
processes the directories as needed:
task :upload do
files = ENV['FILES'].split(/,/)
# ...
end
- Jamis
> --~--~---------~--~----~------------~-------~--~----~
> To unsubscribe from this group, send email to capistrano-
> unsub...@googlegroups.com
> For more options, visit this group at http://groups.google.com/
> group/capistrano
> -~----------~----~----~----~------~----~------~--~---
>
Seems like a workable solution
what might be nice, just thinking about it would be something like:
cap upload(dir_a, dir_b, dir_c)
I know cap depends on rake (and I think i'm in the minority) but
still a thought.
this would also allow
cap deploy(production)
I know Rake has added support for parameterized tasks in the last
year or so. Capistrano doesn't reuse any of Rake's code, but perhaps
it's implementation of the feature might prove inspirational. As
ever, if you want something bad enough, the quickest way to see it
find its way into capistrano is via a patch.
- Jamis
I'm confused that Capistrano doesn't use any of Rake's code as they
seem so close in many ways. I thought Cap was just an extended Rake.
No matter either way of course :)
I'll raise a ticket in the next few days.
Cheers,
-Adam
Ouch. Pardon me while I extract this dagger from my heart. ;)
- Jamis
There see? Good as new.
Now to erase all evidence... this is always the hard part... where
was my Google Trace Removal Kit...
As you will see on the ticket I'm not sure how to continue. Any
feedback welcome.
> >>> Capistrano interprets all bareargumentsas tasks to be executed.
> >>> The multistage extension makes this work by defining tasks for each
> >>> stage, so that "cap production deploy" first calls the "production"
> >>>task, and then calls "deploy".
>
> >>> If you want to pass parameters to your tasks, you can do it via
> >>> environment variables:
>
> >>> cap upload FILES=dir_a,dir_b,dir_c
>
> >>> Then, your uploadtaskgets the FILES env var, parses it, and
> >>> processes the directories as needed:
>
> >>> task:upload do
> >>> files = ENV['FILES'].split(/,/)
> >>> # ...
> >>> end
>
> >>> - Jamis
>
> >>> On Sep 30, 2007, at 1:14 AM, Adam Salter wrote:
>
> >>>> OK, Here's the problem...
> >>>> I'm using Cap as a basic shell script replacement (I don't use SCM
> >>>> etc) I like that it gives you descriptions and namespaces and such
> >>>> for
> >>>> tasks, and it's all going swimmingly - except...
> >>>> I'd like to be able to read theargumentsoff the command into an
> >>>> array...
>
> >>>> cap upload dir_a dir_b dir_c
>
> >>>> I know that the capistrano multistage extension reads several items
> >>>> from the command line, so it should be possible.
>
> >>>> If i just execute the above as is, I get a "taskdir_a not