From e0346dca01d6bc88228804e72f245a1ae0026669 Mon Sep 17 00:00:00 2001 From: yafeilee Date: Sun, 24 Apr 2016 15:22:24 +0800 Subject: [PATCH] Deploy --- Gemfile | 2 +- Gemfile.lock | 6 ++++-- config/deploy.rb | 16 +++++++++------- config/deploy/zh.rb | 3 +-- 4 files changed, 15 insertions(+), 12 deletions(-) diff --git a/Gemfile b/Gemfile index 02e6225..c04b2e4 100644 --- a/Gemfile +++ b/Gemfile @@ -41,7 +41,7 @@ gem 'puma' gem 'mina', require: false gem 'mina-multistage', require: false gem 'mina-sidekiq', require: false -gem 'mina-unicorn', require: false +gem 'mina-puma', require: false group :development do gem 'quiet_assets' diff --git a/Gemfile.lock b/Gemfile.lock index ffc774e..c3c5998 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -152,9 +152,11 @@ GEM rake mina-multistage (1.0.2) mina (>= 0.2.1) + mina-puma (0.3.0) + mina + puma (>= 2.13) mina-sidekiq (0.3.1) mina - mina-unicorn (0.4.0) mini_magick (4.5.1) mini_portile2 (2.0.0) minitest (5.8.4) @@ -345,8 +347,8 @@ DEPENDENCIES listen (~> 3.0.5) mina mina-multistage + mina-puma mina-sidekiq - mina-unicorn mini_magick newrelic_rpm nokogiri diff --git a/config/deploy.rb b/config/deploy.rb index 80a7ace..a04f3d4 100644 --- a/config/deploy.rb +++ b/config/deploy.rb @@ -5,17 +5,19 @@ require 'mina/multistage' require 'mina/bundler' require 'mina/rails' require 'mina/git' -require 'mina/rvm' # for rvm support. (http://rvm.io) -require 'mina/unicorn' +require 'mina/rvm' +require 'mina/puma' require 'mina_sidekiq/tasks' # Manually create these paths in shared/ (eg: shared/config/database.yml) in your server. # They will be linked in the 'deploy:link_shared_paths' step. -set :shared_paths, ['config/mongoid.yml', 'config/application.yml', 'log', 'tmp', 'public/uploads', 'public/personal' ] +set :shared_paths, ['config/database.yml', 'config/application.yml', 'log', 'tmp', 'public/uploads', 'public/personal' ] + +# rvm path +set :rvm_path, '/usr/local/rvm/scripts/rvm' task :environment do - queue! %[source /usr/local/rvm/scripts/rvm] - queue! %[rvm use 2.0.0] + invoke :'rvm:use[2.2.3]' end task :setup => :environment do @@ -24,7 +26,7 @@ task :setup => :environment do queue! %[chmod g+rx,u+rwx "#{deploy_to}/shared/#{dir}"] end - ['config/mongoid.yml', 'config/application.yml'].each do |file| + ['config/database.yml', 'config/application.yml'].each do |file| queue! %[touch "#{deploy_to}/shared/#{file}"] queue %[echo "-----> Be sure to edit 'shared/#{file}'."] end @@ -47,7 +49,7 @@ task :deploy => :environment do invoke :'rails:assets_precompile' to :launch do - invoke :'unicorn:restart' + invoke :'puma:restart' invoke :'sidekiq:restart' end end diff --git a/config/deploy/zh.rb b/config/deploy/zh.rb index f568d5f..dbd7fcc 100644 --- a/config/deploy/zh.rb +++ b/config/deploy/zh.rb @@ -1,6 +1,5 @@ set :domain, 'yafeilee.me' set :deploy_to, '/home/ruby/wblog' set :repository, 'git@github.com:windy/wblog.git' -set :branch, 'master' +set :branch, 'new_design' set :user, 'ruby' -set :unicorn_config, -> { "#{deploy_to}/#{current_path}/config/unicorn/zh.rb" }