require 'mina/bundler' require 'mina/rails' require 'mina/git' # require 'mina/rbenv' # for rbenv support. (https://rbenv.org) # require 'mina/rvm' # for rvm support. (https://rvm.io) # Basic settings: # domain - The hostname to SSH to. # deploy_to - Path to deploy into. # repository - Git repo to clone from. (needed by mina/git) # branch - Branch name to deploy. (needed by mina/git) set :domain, 'foobar.com' set :deploy_to, '/var/www/foobar.com' set :repository, 'git://...' set :branch, 'master' # Optional settings: # set :user, 'foobar' # Username in the server to SSH to. # set :port, '30000' # SSH port number. # set :forward_agent, true # SSH forward_agent. # They will be linked in the 'deploy:link_shared_paths' step. # set :shared_dirs, -> { fetch(:shared_dirs, []).push('config') } # set :shared_files, -> { fetch(:shared_files, []).push('config/database.yml', 'config/secrets.yml') } # This task is the environment that is loaded for most commands, such as # `mina deploy` or `mina rake`. task :environment do # If you're using rbenv, use this to load the rbenv environment. # Be sure to commit your .ruby-version or .rbenv-version to your repository. # invoke :'rbenv:load' # For those using RVM, use this to load an RVM version@gemset. # invoke :'rvm:use[ruby-1.9.3-p125@default]' end # Put any custom commands you need to run at setup # All paths in `shared_dirs` and `shared_paths` will be created on their own. task setup: :environment do # command 'rbenv install 2.3.0' end desc "Deploys the current version to the server." task deploy: :environment 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 :'deploy:link_shared_paths' invoke :'bundle:install' 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 # For help in making your deploy script, see the Mina documentation: # # - https://github.com/mina-deploy/mina/docs