deploy_to for current_path?

550 views
Skip to first unread message

sol

unread,
Jul 11, 2007, 2:49:05 PM7/11/07
to Capistrano
Hey,

Shouldn't deploy_to affect the current_path var?

I set deploy_to to /var/apps, and if I try to cap restart, it still
uses the /u/ prefix.
release_path uses the correct /var/apps prefix.

my version: 1.99.2

thanks,
Christoph

Jamis Buck

unread,
Jul 11, 2007, 2:54:56 PM7/11/07
to capis...@googlegroups.com
Can you show me your deploy.rb file?

- Jamis

sol

unread,
Jul 11, 2007, 3:05:40 PM7/11/07
to Capistrano
I think I could clean it up a bit, but I don't have the time right
now, so it might seem a bit confusing :)

http://pastie.caboo.se/78103

Jamis Buck

unread,
Jul 11, 2007, 3:20:38 PM7/11/07
to capis...@googlegroups.com
I wonder if something in mongrel_cluster/recipes is grabbing
current_path before you set the deploy_to variable... you might try
moving that require below where you set deploy_to and see what
happens.

- Jamis

On 7/11/07, sol <ch.b...@gmail.com> wrote:
>

sol

unread,
Jul 11, 2007, 3:29:30 PM7/11/07
to Capistrano
I removed it, but it still uses /u/ for current_path

Jamis Buck

unread,
Jul 11, 2007, 3:42:05 PM7/11/07
to capis...@googlegroups.com
In the pastie, there is a line that says:

# some custom app vars here

Is that literally in your file, or did you elide some content before
pastie-ing it? Also, how are you testing the value of current_path?

- Jamis

On 7/11/07, sol <ch.b...@gmail.com> wrote:
>

sol

unread,
Jul 11, 2007, 3:53:01 PM7/11/07
to Capistrano
I tested with the restart task, which uses the current_path, and I
just printed out the vars, which seems to show the correct values.

I removed some lines where you see "# some custom app vars here" but
thats mainly usernames, password and vars for my custom tasks, like
nginx server aliases.
I don't think that this affects the path though.

Jamis Buck

unread,
Jul 11, 2007, 3:56:45 PM7/11/07
to capis...@googlegroups.com
Do any of those elided variables themselves refer to any standard
capistrano variable, like deploy_to or current_path or release_path,
etc?

Can you show me the restart task, with your changes in it?

- Jamis

On 7/11/07, sol <ch.b...@gmail.com> wrote:
>

sol

unread,
Jul 11, 2007, 4:03:26 PM7/11/07
to Capistrano
> Do any of those elided variables themselves refer to any standard
> capistrano variable, like deploy_to or current_path or release_path,
> etc?

hm, one var does:
set :mongrel_conf, "#{current_path}/config/mongrel_cluster.yml"
the others are just some strings like username, domainname, etc

> Can you show me the restart task, with your changes in it?

I meant the deploy:restart task, it uses /u/ if I try it, I did not
change anything.
also printing those vars to stdout shows the wrong path (after
deploy_to)

Jamis Buck

unread,
Jul 11, 2007, 4:17:06 PM7/11/07
to capis...@googlegroups.com
Yup, that set :mongrel_conf is the culprit. Try this instead:

set(:mongrel_conf) { "#{current_path}/config/mongrel_cluster.yml" }

Putting it in braces forces it to be evaluated lazily, when it is
first needed. Which will hopefully be after you've changed the
:deploy_to variable.

- Jamis


On 7/11/07, sol <ch.b...@gmail.com> wrote:
>

sol

unread,
Jul 11, 2007, 4:31:14 PM7/11/07
to Capistrano
Ah you're right :)

Thanks a lot Jamis, although I should have noticed this myself :)

Reply all
Reply to author
Forward
0 new messages