secret
Created

  • Download Gist
deploy.rb
Ruby
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67
require 'rvm/capistrano'
require 'capistrano/ext/multistage'
require 'capistrano-lazy-assets'
require 'bundler/capistrano'
require 'puma/capistrano'
require 'capistrano-db-tasks'
 
#############################################################
# Settings
#############################################################
 
set :stages, %w(staging production)
set :default_stage, "staging"
set :rvm_type, :user
set :normalize_asset_timestamps, false
set :bundle_without, %w(development test)
set :application, "CardioGO"
set :scm, :git
set :repository, "gitserver:cardiogo"
set :branch, 'staging'
set :keep_releases, 10
 
#############################################################
# Additional Capistrano Tasks
#############################################################
 
desc "Create all necessary directories for a new server."
after "deploy:setup" do
run "mkdir -pm 700 #{shared_path}"
run "mkdir -pm 700 #{shared_path}/config"
run "mkdir -pm 700 #{shared_path}/assets"
run "mkdir -pm 700 #{shared_path}/log"
run "mkdir -pm 700 #{releases_path}"
end
 
namespace :deploy do
desc "Create all shared links"
task :create_symlinks, :roles => :app do
run "ln -nfs #{shared_path}/config/database.yml #{release_path}/config/database.yml"
end
end
 
namespace :deploy do
desc "Create data folder"
task :create_data_folder, :roles => :app do
run "mkdir #{release_path}/data"
end
end
 
namespace :deploy do
task :compile_edffile, :roles => :app do
run "cd #{release_path}/ && bundle exec rake compile:edffile"
end
end
 
#############################################################
# Overwritten Capistrano Tasks
#############################################################
 
#############################################################
# Hooks
#############################################################
after 'deploy', 'deploy:cleanup'
before 'deploy:create_symlink', 'deploy:create_symlinks'
after 'deploy:create_symlinks', 'deploy:create_data_folder'
after "deploy:create_data_folder", "deploy:compile_edffile"
after 'deploy:compile_ext', 'deploy:migrate'

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.