Specify port on deploy

115 views
Skip to first unread message

pcar...@remedia.it

unread,
Mar 30, 2016, 5:08:34 AM3/30/16
to Capistrano
Versions:
  • Ruby : ruby 2.0.0p645
  • Capistrano : 3.4.0
  • Rake   10.3.2
Platform:
  • Bedrock, a framework to build wordpress site
Files:
  • Capfile - I'm goin to  attach it to you
  • deploy.rb  - I'm goin to  attach it to you
  • Stage files (staging.rb)  - I'm goin to  attach it to you




Hi,

I can't deploy my bedrock with capistrano to another port, different than 22.

Googling this problem, I tried to specifiy the port in 4 different way:

1 - In the definition of a rule, in this two way:

role :app, %w{us...@mysshdomain.cloudapp.net}, port: 60601
role :app, %w{us...@mysshdomain.cloudapp.net:60601}

2- In the definition of the server, in this two way:

server 'mysshdomain.cloudapp.net', user: 'user', roles: %w{web app db}, port: 60601
server 'mysshdomain.cloudapp.net:60601', user: 'user', roles: %w{web app db}

3 - Using the ssh_option variable , in this way:

 set :ssh_options, {
    port: 60601
 }

4 - Using the variable port, in this way:

set :port , 60601

None of this seems to work, but maybe I 'm making some errors.



Could you please help me?



NB : Of course, with terminal I have no problem to log in the remote server specifyng the port.




Lee Hambley

unread,
Mar 30, 2016, 5:09:31 AM3/30/16
to Capistrano
Seems like you found outdated guide that aren't clear about which version of Capistrano they refer to. Please read https://github.com/capistrano/sshkit#tunneling-and-other-related-ssh-themes and try that.

--
You received this message because you are subscribed to the Google Groups "Capistrano" group.
To unsubscribe from this group and stop receiving emails from it, send an email to capistrano+...@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/capistrano/c9dd759b-1b4d-4f6e-87bd-5c8fc28f2730%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

pcar...@remedia.it

unread,
Mar 30, 2016, 12:41:35 PM3/30/16
to Capistrano
Hi Lee, 

thanks for the answer, but  I can't find a documented solution on how to specify the port in your link,  I'm not very fluent with ruby so for me reading the source code it's a little bit difficult at the moment.


Il giorno mercoledì 30 marzo 2016 11:09:31 UTC+2, Lee Hambley ha scritto:
Seems like you found outdated guide that aren't clear about which version of Capistrano they refer to. Please read https://github.com/capistrano/sshkit#tunneling-and-other-related-ssh-themes and try that.
On 30 March 2016 at 11:00, <pcar...@remedia.it> wrote:
Versions:
  • Ruby : ruby 2.0.0p645
  • Capistrano : 3.4.0
  • Rake   10.3.2
Platform:
  • Bedrock, a framework to build wordpress site
Files:
  • Capfile - I'm goin to  attach it to you
  • deploy.rb  - I'm goin to  attach it to you
  • Stage files (staging.rb)  - I'm goin to  attach it to you


Hi,

I can't deploy my bedrock with capistrano to another port, different than 22.

Googling this problem, I tried to specifiy the port in 4 different way:

1 - In the definition of a rule, in this two way:

role :app, %w{u...@mysshdomain.cloudapp.net}, port: 60601

2- In the definition of the server, in this two way:

server 'mysshdomain.cloudapp.net', user: 'user', roles: %w{web app db}, port: 60601
server 'mysshdomain.cloudapp.net:60601', user: 'user', roles: %w{web app db}

3 - Using the ssh_option variable , in this way:

 set :ssh_options, {
    port: 60601
 }

4 - Using the variable port, in this way:

set :port , 60601

None of this seems to work, but maybe I 'm making some errors.



Could you please help me?



NB : Of course, with terminal I have no problem to log in the remote server specifyng the port.




Lee Hambley

unread,
Mar 30, 2016, 1:36:58 PM3/30/16
to Capistrano

pcar...@remedia.it

unread,
Apr 4, 2016, 5:20:00 AM4/4/16
to Capistrano
Thank you, Thank you very much.

For thoose that came here, 
I found very useful this reply that you have done in the past:


Editing the ssh_config in local and change the host in the staging.rb file works for me!
Reply all
Reply to author
Forward
0 new messages