It looks like Capistrano needs to execute the commands like this: A=B X=Y sh -c "command && command && command"
That, or: export A=B X=Y && command && command && command The latter would probably be less prone to quoting problems. It might eventually be more easily extended to support non-POSIX shells, too, though that's not really a priority. I'll see what I can figure out. - Jamis On Jun 19, 2007, at 8:29 AM, Eric Anderson wrote: > > On Jun 19, 1:43 am, pbm <[EMAIL PROTECTED]> wrote: >> First, thanks for adding the default_environment[], my hosting >> company >> has the SSHD PermitUserEnvironment disabled, so I'm glad to see the >> new >> feature in capistrano 2. I believe, however, there is a bug in it. >> >> Capistrano tries to run commands of the form >> >> A && B && C >> >> but the environment variables are only set for the first element of >> the list. > > I am getting a similar problem. My hosting provider also has the user > environment disabled. I have tried specifying /bin/bash as my shell > but my profile is still not being sourced from what I can tell. In my > case if I use default_environment[] then it fails with the following > command: > > GEM_PATH=/home/pix/gems:/usr/lib/ruby/gems/1.8 cd /home/pix/apps/ > calendar_list/releases/20070619140931; rake RAILS_ENV=production > db:migrate" > > The environment variable is only applied to the first command (the > cd). The second command after the ";" does not have the right > environment set. > > Could we just drop the default_environment[] and instead allow the > capfile to specify a shell script to source before executing remote > commands? That would allow the user to set up as many environment > variables as needed, run any pre-processing and keep the commands sent > readable (if you set just a few environment variables the commands > will get hard to understand and might exceed the line length limit). > > Eric > > > > --~--~---------~--~----~------------~-------~--~----~ To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/capistrano -~----------~----~----~----~------~----~------~--~---
