If you want to write ruby code on your own and deploy it at any time, you can view it everywhere. The heroku domain name is unfriendly and slow in China, so I think of capistrano, so I started learning...
Capistrano
Https://www.evernote.com/shard/s6/sh/72a2b7c8-d531-4efc-9e16-ac82af2a92b7/e54fca8a9e7014ad87c79e7a7a5538c4
Capistrano new version installation
Http://capistranorb.com/documentation/getting-started/preparing-your-application/
Http://capistranorb.com/
# Deploy in Gemfile
Gem 'capistrano ',' ~> 3.2.0'
Just complete the installation and generate the capfile...
$ Bundle exec cap install
Detailed Configuration:
$ Vim config/deploy/production. rb
# Content
11 server 'qzi. me', roles: [: demo], port: 1234, user: 'qzi'
12 task: uptime do | host |
13 on roles (: demo), in: parallel do
14 uptime = capture (: uptime)
15 hostname = capture (: hostname)
16 puts "# {hostname} reports: # {uptime }"
17 end
18 end
$ Cap production uptime
Better Syntax:
$ Vim config/deploy/production. rb
Server 'qzi. me', roles: [: demo], port: 1234, user: 'qzi'
$ Vim lib/capistrano/tasks/test. rake
Desc "check the uptime on the host"
Task: uptime do | host |
On roles (: demo), in: parallel do
Uptime = capture (: uptime)
Hostname = capture (: hostname)
Puts "# {hostname} reports: # {uptime }"
End
End
$ Cap-T # Check your new command
Ssh should first avoid rsa password-free login. This is a digress, which can be Baidu;
There is also a way to explain how to deploy the rails project. For example, passag and unicorn won't be difficult;
Of course, you need hosts, domain names, and so on;
Now let's take a look at this. The host login and operation commands have all been reached. Later, sort out the notes and add some more...