Skip to content

Instantly share code, notes, and snippets.

@d4be4st
Last active August 29, 2015 14:24
Show Gist options
  • Save d4be4st/643691f233c9e0994d33 to your computer and use it in GitHub Desktop.
Save d4be4st/643691f233c9e0994d33 to your computer and use it in GitHub Desktop.
mina 0.3.6 deploy script
require 'mina/bundler'
require 'mina/rails'
require 'mina/git'
set :repository, "git@bitbucket.org:infinum_hr/web_app.git"
set :user, 'staging'
set :port, 22220
set :domain, 'app.infinum.co'
set :deploy_to, '/home/staging/www/a/app.infinum.co'
set :rails_env, 'production'
set :branch, 'master'
set :shared_paths, ['log']
task :deploy => :environment do
deploy do
invoke :'git:clone'
invoke :'deploy:link_shared_paths'
invoke :'bundle:install'
invoke :'rails:db_create' if ENV['create']
invoke :'rails:db_migrate'
invoke :'rails:assets_precompile'
invoke :'deploy:cleanup'
to :launch do
invoke :restart_application
end
end
end
# Just overwrote to execute stages first
task :setup => :envirnment do
queue! %[mkdir -p "#{deploy_to}/shared/log"]
end
# Restart application after deployment
task :restart_application do
queue %[echo "-----> Restarting application"]
queue! %[sudo passenger-config restart-app --ignore-app-not-running #{deploy_to}]
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment