Iterative edge deployment using Capistrano and writing Ruby

Source: Internet
Author: User

Want to write their own ruby code, side deployment at any time to look around, Heroku domain name is not friendly, speed in the country and slow. So think up Capistrano, then learn ...


Capistrano a little bit of introductory cognition

Https://www.evernote.com/shard/s6/sh/72a2b7c8-d531-4efc-9e16-ac82af2a92b7/e54fca8a9e7014ad87c79e7a7a5538c4


Capistrano new version of the installation

http://capistranorb.com/documentation/getting-started/preparing-your-application/

http://capistranorb.com/

# Deploy in Gemfile
Gem ' Capistrano ', ' ~> 3.2.0 '


The installation can be completed. and generate Capfile and so on ...

$bundle Exec Cap Install


Specific configuration:

$vim config/deploy/production.rb

# # Content
One server ' qzi.me ', roles: [:d emo], port:1234, User: ' Qzi '
Task:uptime do |host|
Over roles (:d emo), in::p arallel do
Uptime = Capture (: uptime)
hostname = Capture (: hostname)
Puts "#{hostname} reports: #{uptime}"
End
End

$ cap Production uptime




Better wording:

$vim config/deploy/production.rb

Server ' qzi.me ', roles: [:d emo], port:1234, User: ' Qzi '


$ vim Lib/capistrano/tasks/test.rake

Desc "Check the uptime on the host"
Task:uptime do |host|
On roles (:d emo), in::p arallel do
Uptime = Capture (: uptime)
hostname = Capture (: hostname)
Puts "#{hostname} reports: #{uptime}"
End

End


$cap-T # to find your new command.


SSH itself first free RSA password login. This is off-topic, can Baidu;

There is the rails project how to deploy to explain the other to learn, for example, passenger, unicorn, etc. are not very difficult;

Of course, you have to have a host, domain names and the like;

Let's do this on a temporary basis. Host landing and Operation commands have been point to, later put the notes again through with some hit together ...

Copyright notice: This article blog original articles, blogs, without consent, may not be reproduced.

Iterative edge deployment using Capistrano and writing Ruby

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.