Skip to content
Create a gist now

Instantly share code, notes, and snippets.

My mina deploy setup
require 'mina/bundler'
require 'mina/rails'
require 'mina/git'
require 'mina/rbenv'
# Basic settings:
# domain - The hostname to SSH to
# deploy_to - Path to deploy into
# repository - Git repo to clone from (needed by mina/git)
# user - Username in the server to SSH to (optional)
set :domain, ''
set :deploy_to, '/var/www/'
set :repository, ''
set :user, 'joerg'
set :port, '404'
desc "Load gem enviroment"
task :gem_path do
queue %{
#{echo_cmd %{export PATH="$PATH:$HOME/.gems/bin" GEM_HOME="$HOME/.gems"}}
# database config (with password) remains this way on the server
desc "Symlink shared configs"
task :symlink_shared do
queue %{
#{echo_cmd %{ln -nfs #{deploy_to}/#{shared_path}/config/database.yml ./config/database.yml}}
task :enviroment => :gem_path do
invoke :'rbenv:load'
invoke :gem_path
desc "Deploys the current version to the server."
task :deploy => :enviroment do
deploy do
# Put things that will set up an empty directory into a fully set-up
# instance of your project.
invoke :'git:clone'
invoke :'bundle:install'
invoke :'symlink_shared'
invoke :'rails:db_migrate'
invoke :'rails:assets_precompile'
to :launch do
queue 'bundle exec thin restart -C config/thin.yml'
queue 'sudo /etc/init.d/nginx reload' # allow nopasswd in visudo for nginx' init script.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.