➜ XXX git:(master) ✗ mina setup -v
[email protected]'s password:
-----> Setting up /home/deploy/XXX.com
$ mkdir -p "/home/deploy/XXX.com"
$ mkdir -p "/home/deploy/XXX.com/releases"
$ mkdir -p "/home/deploy/XXX.com/shared"
$ cd /home/deploy/XXX.com/shared
$ mkdir -p "vendor/bundle"
$ mkdir -p "log"
$ mkdir -p "tmp/cache"
$ mkdir -p "public/assets"
$ mkdir -p "log"
$ mkdir -p "config"
$ mkdir -p "config"
$ if [ -x "$(command -v tree)" ]; then tree -d -L 2 "/home/deploy/XXX.com"; else ls -al "/home/dep
loy/XXX.com"; fi
total 16
drwxr-xr-x 4 deploy root 4096 Nov 29 12:56 .
drwxr-xr-x 6 deploy root 4096 Nov 29 12:56 ..
drwxr-xr-x 2 deploy root 4096 Nov 29 12:56 releases
drwxr-xr-x 7 deploy root 4096 Nov 29 12:56 shared
$ if ! ssh-keygen -H -F github.com &>/dev/null; then
ssh-keyscan -t rsa -p 22 -H github.com >> ~/.ssh/known_hosts
fi
Connection to 115.28.150.205 closed.
Elapsed time: 5.72 seconds
require 'mina/rails'
require 'mina/git'
require 'mina/rvm' # for rvm support. (https://rvm.io)
set :user, 'deploy'
set :domain, '115.28.150.205'
set :deploy_to, '/home/deploy/XXX.com'
set :repository, '[email protected]:XXX/daquan.git'
set :branch, 'master'
set :rvm_path, '/usr/local/rvm/scripts/rvm'
set :shared_dirs, fetch(:shared_dirs, []).push('log')
set :shared_files, fetch(:shared_files, []).push('config/database.yml', 'config/secrets.yml')
task :environment do
invoke :'rvm:use', 'ruby-2.3.3@default'
end
task :setup do
# command %{rbenv install 2.3.0}
end
desc "Deploys the current version to the server."
task :deploy do
deploy do
invoke :'git:clone'
invoke :'deploy:link_shared_paths'
invoke :'bundle:install'
#数据库已经migrate
#invoke :'rails:db_migrate'
invoke :'rails:assets_precompile'
invoke :'deploy:cleanup'
on :launch do
in_path(fetch(:current_path)) do
command %{mkdir -p tmp/}
command %{touch tmp/restart.txt}
end
end
end
end
deploy@iZm5ej37sq84m7zum1fn7hZ:~$ ruby -v
ruby 2.3.3p222 (2016-11-21 revision 56859) [x86_64-linux]
deploy@iZm5ej37sq84m7zum1fn7hZ:~$ rvm -v
rvm 1.27.0 (latest) by Wayne E. Seguin <[email protected]>, Michal Papis <[email protected]> [https://rvm.
io/]
deploy@iZm5ej37sq84m7zum1fn7hZ:~$ git --version
git version 1.9.1
user deploy;
worker_processes 1;
pid /var/run/nginx.pid;
events {
worker_connections 1024;
}
http {
passenger_root /usr/local/rvm/gems/ruby-2.3.3/gems/passenger-5.0.30;
passenger_ruby /usr/local/rvm/gems/ruby-2.3.3/wrappers/ruby;
include mime.types;
default_type application/octet-stream;
access_log /var/log/nginx/access.log;
error_log /var/log/nginx/error.log;
sendfile on;
#keepalive_timeout 0;
keepalive_timeout 65;
gzip on;
server {
listen 80;
server_name www.XXX.com;
rails_env production;
root /home/deploy/XXX.com/current/public;
passenger_enabled on;
location ~ ^(/assets) {
access_log off;
expires max;
}
...