/config/deploy.rb
Ruby | 97 lines | 25 code | 25 blank | 47 comment | 0 complexity | ac362833ea0956dd7827c5db2b469762 MD5 | raw file
- # config valid for current version and patch releases of Capistrano
- lock "~> 3.10.1"
- set :application, "purefame"
- set :repo_url, "git@bitbucket.org:purefame/purefame.git"
- # Default branch is :master
- ask :branch, `git rev-parse --abbrev-ref HEAD`.chomp
- set :stages, ["staging", "production"]
- set :default_stage, "staging"
- # Defaults to :db role
- #set :migration_role, :db
- set :migration_role, :app
- # Defaults to the primary :db server
- set :migration_servers, -> { primary(fetch(:migration_role)) }
- # Defaults to false
- # Skip migration if files in db/migrate were not modified
- set :conditionally_migrate, true
- # Defaults to [:web]
- set :assets_roles, [:web, :app]
- # Defaults to 'assets'
- # This should match config.assets.prefix in your rails config/application.rb
- #set :assets_prefix, 'prepackaged-assets'
- # RAILS_GROUPS env value for the assets:precompile task. Default to nil.
- set :rails_assets_groups, :assets
- # If you need to touch public/images, public/javascripts, and public/stylesheets on each deploy
- set :normalize_asset_timestamps, %w{public/images public/javascripts public/stylesheets}
- # Defaults to nil (no asset cleanup is performed)
- # If you use Rails 4+ and you'd like to clean up old assets after each deploy,
- # set this to the number of versions to keep
- set :keep_assets, 2
- # Default value for :format is :airbrussh.
- # set :format, :airbrussh
- # You can configure the Airbrussh format using :format_options.
- # These are the defaults.
- # set :format_options, command_output: true, log_file: "log/capistrano.log", color: :auto, truncate: :auto
- # Default value for :pty is false
- # set :pty, true
- # Default value for :linked_files is []
- # append :linked_files, "config/database.yml", "config/secrets.yml"
- # Default value for linked_dirs is []
- # append :linked_dirs, "log", "tmp/pids", "tmp/cache", "tmp/sockets", "public/system"
- append :linked_dirs, 'log', 'tmp/pids', 'tmp/cache', 'tmp/sockets', 'vendor/bundle', '.bundle', 'public/system', 'public/uploads'
- append :linked_files, 'config/database.yml', 'config/secrets.yml'
- # Default value for default_env is {}
- # set :default_env, { path: "/opt/ruby/bin:$PATH" }
- # Default value for local_user is ENV['USER']
- # set :local_user, -> { `git config user.name`.chomp }
- # Default value for keep_releases is 5
- # set :keep_releases, 5
- # Uncomment the following to require manually verifying the host key before first deploy.
- # set :ssh_options, verify_host_key: :secure
- #namespace :deploy do
- # task :start do ; end
- # task :stop do ; end
- # task :restart, :roles => :app, :except => { :no_release => true } do
- # run "#{try_sudo} touch #{File.join(current_path,'tmp','restart.txt')}"
- # end
- #end
- ##after "deploy:update_code", :bundle_install
- #desc "Running the bundle install"
- #task :bundle_install, :roles => :app do
- # run "cd #{release_path} && bundle install"
- #end
- namespace :deploy do
- after :restart, :restart_passenger do
- on roles(:web), in: :groups, limit: 3, wait: 10 do
- within release_path do
- execute :touch, 'tmp/restart.txt'
- end
- end
- end
- after :finishing, 'deploy:restart_passenger'
- end