[Capistrano] Re: Changing directory in task
It is worth noting for the sake of completeness - although it's more of a Bash (or any shell) feature. That will execute the following task only if the first one is successful. run cd /path ls -al Wouldnt' run the ls command if it couldn't change directory.. which in this instance makes sense, the following would execute the bash commands in order until the end of the string. run cd /path ; ls -al Meaning that you can get away with not being able to change directory, or something. run -EOB if [ -d /path ]; then { cd /path; ls -al } fi; EOB Not the most useful hack in the world.. but it just ties in with what I'm working on on the documentation at the moment - so I mention it anyway :) On Oct 8, 2:56 pm, Jamis Buck [EMAIL PROTECTED] wrote: Each run() is done in a subshell, so any changes made to your session's state there are lost. Similarly, you cannot set environment variables that you want to persist across run calls, either. The way to do this is to execute all the commands together in a single run() invocation: run cd /path ls -al - Jamis On Oct 8, 2008, at 2:45 AM, thomas.mery wrote: Hello all, Maybe this ha been answered before but could not find the solution ... I simply want to change directory within a task to be able to run a command in a specific directory but it fails here is my test task : desc TEST task :test do run cd /home/myaccount/mydirectory run ls -al end the output of the ls command will show the content of my user directory (the one I access when logging in) but not the content of the directory I 'cd'ed into (output shows no error when issuing the cd command) I am probably missing something obvious here but I would really appreciate any insight :) thanks in advance thomas --~--~-~--~~~---~--~~ To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/capistrano -~--~~~~--~~--~--~---
[Capistrano] using non-standard port with capistrano and git
Hi, I am trying to deploy to my production server using a non-standard port, such as 1234 . (Using capistrano, git and github as repo.) Everything worked perfectly when I used port 22. I updated the deploy.rb as follows: ssh_options[:port] = 1234 But now I am getting this error: 'ssh: connect to host github.com port 1234: Connection refused' The system assumes that I want to connect to the repo at that port, which I don't. It's the port for my production server. The repo settings should not be changed! Whatever I try I can't work around this. This puzzles me since I assume that quite a lot of people would use the github capistrano , non-standard port combination but didn't find anything on Google. Thus: How do I set the deploy.rb correctly? Or do I need to change something else? It worked fine when I used standard port 22. Thanks, Justus --~--~-~--~~~---~--~~ To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/capistrano -~--~~~~--~~--~--~---
[Capistrano] Re: using non-standard port with capistrano and git
Hi Justus, There probably is a way to do this in your capistrano configuration - but I can vouch for Net::SSH honoring your port settings from your ssh client configuration file. Todo: 1. Edit ~/.ssh/config 2. Add something like this: Host my.host.com Port 3. Ensure that it loads, by testing something like ssh my.host.com (omit the port) and ensure that it connects properly.. 4. Try capistrano again. 5. Come and let us know how that worked out for you :) -- Further reading about SSH client config here in the man page (or, of course through man) -- http://linux.die.net/man/5/ssh_config -- Lee Hambley On Oct 9, 9:01 pm, ohlhaver [EMAIL PROTECTED] wrote: Hi, I am trying to deploy to my production server using a non-standard port, such as 1234 . (Using capistrano, git and github as repo.) Everything worked perfectly when I used port 22. I updated the deploy.rb as follows: ssh_options[:port] = 1234 But now I am getting this error: 'ssh: connect to host github.com port 1234: Connection refused' The system assumes that I want to connect to the repo at that port, which I don't. It's the port for my production server. The repo settings should not be changed! Whatever I try I can't work around this. This puzzles me since I assume that quite a lot of people would use the github capistrano , non-standard port combination but didn't find anything on Google. Thus: How do I set the deploy.rb correctly? Or do I need to change something else? It worked fine when I used standard port 22. Thanks, Justus --~--~-~--~~~---~--~~ To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/capistrano -~--~~~~--~~--~--~---
[Capistrano] Re: using non-standard port with capistrano and git
Hi Lee, Thanks a lot for your help. This was resolved by setting the default port to 22 in /etc/ssh/ssh_config on the prod server. Thanks again and good night, Justus On Thu, Oct 9, 2008 at 11:20 PM, Lee Hambley [EMAIL PROTECTED] wrote: Hi Justus, There probably is a way to do this in your capistrano configuration - but I can vouch for Net::SSH honoring your port settings from your ssh client configuration file. Todo: 1. Edit ~/.ssh/config 2. Add something like this: Host my.host.com Port 3. Ensure that it loads, by testing something like ssh my.host.com (omit the port) and ensure that it connects properly.. 4. Try capistrano again. 5. Come and let us know how that worked out for you :) -- Further reading about SSH client config here in the man page (or, of course through man) -- http://linux.die.net/man/5/ssh_config -- Lee Hambley On Oct 9, 9:01 pm, ohlhaver [EMAIL PROTECTED] wrote: Hi, I am trying to deploy to my production server using a non-standard port, such as 1234 . (Using capistrano, git and github as repo.) Everything worked perfectly when I used port 22. I updated the deploy.rb as follows: ssh_options[:port] = 1234 But now I am getting this error: 'ssh: connect to host github.com port 1234: Connection refused' The system assumes that I want to connect to the repo at that port, which I don't. It's the port for my production server. The repo settings should not be changed! Whatever I try I can't work around this. This puzzles me since I assume that quite a lot of people would use the github capistrano , non-standard port combination but didn't find anything on Google. Thus: How do I set the deploy.rb correctly? Or do I need to change something else? It worked fine when I used standard port 22. Thanks, Justus --~--~-~--~~~---~--~~ To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/capistrano -~--~~~~--~~--~--~---