-
-
Save yorzi/15c1595d4e76ac53dde98b5604b471d0 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'mina/rails' | |
require 'mina/git' | |
require 'mina/rvm' | |
require 'mina/puma' | |
set :application_name, 'myapp' | |
set :domain, 'myapp.com' | |
set :deploy_to, '/home/admin/myapp' | |
set :repository, '[email protected]:lnikell/myapp.git' | |
set :shared_dirs, fetch(:shared_dirs, []).push('log', 'tmp/pids', 'tmp/sockets', 'public/uploads') | |
set :shared_files, fetch(:shared_files, []).push('config/database.yml', 'config/secrets.yml', 'config/puma.rb') | |
set :user, 'admin' | |
task :environment do | |
invoke :'rvm:use', 'ruby-2.3.0@default' | |
end | |
task :setup do | |
command %[touch "#{fetch(:shared_path)}/config/database.yml"] | |
command %[touch "#{fetch(:shared_path)}/config/secrets.yml"] | |
command %[touch "#{fetch(:shared_path)}/config/puma.rb"] | |
comment "Be sure to edit '#{fetch(:shared_path)}/config/database.yml', 'secrets.yml' and puma.rb." | |
end | |
task :deploy do | |
deploy do | |
comment "Deploying #{fetch(:application_name)} to #{fetch(:domain)}:#{fetch(:deploy_to)}" | |
invoke :'git:clone' | |
invoke :'deploy:link_shared_paths' | |
invoke :'bundle:install' | |
invoke :'rails:db_migrate' | |
invoke :'rails:assets_precompile' | |
invoke :'deploy:cleanup' | |
on :launch do | |
invoke :'puma:restart' | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment