Skip to content

Instantly share code, notes, and snippets.

@HendrikPetertje
Created December 12, 2013 13:34
Show Gist options
  • Save HendrikPetertje/7927999 to your computer and use it in GitHub Desktop.
Save HendrikPetertje/7927999 to your computer and use it in GitHub Desktop.
set :rbenv_ruby, "2.0.0-p353"
set :application, 'vivorbi'
set :repo_url, 'github ssh repo'
# ask :branch, proc { `git rev-parse --abbrev-ref HEAD`.chomp }
set :scm, :git
set :format, :pretty
set :log_level, :info
# set :linked_files, %w{config/database.yml}
set :linked_dirs, %w{bin log tmp/pids tmp/cache tmp/sockets vendor/bundle public/system}
set :default_env, { path: "$HOME/.rbenv/shims:$HOME/.rbenv/bin:$PATH" }
set :keep_releases, 5
#set :normalize_asset_timestamps, false
set :normalize_asset_timestamps, %{public/images public/javascripts public/stylesheets}
set :migration_role, 'database-user' # Defaults to 'db'
namespace :deploy do
desc 'Restart application'
task :restart do
on roles(:app), in: :sequence, wait: 5 do
execute :touch, release_path.join('tmp/restart.txt')
end
end
after :restart, :clear_cache do
end
# after "deploy", "deploy:migrate"
after :finishing, 'deploy:cleanup'
end
namespace :deploy do
desc "reload the database with seed data"
task :seed do
run "cd #{current_path}; rake db:seed RAILS_ENV=#{rails_env}"
end
end
set :stage, :production
role :app, %w{serverip:port}
role :web, %w{serverip:port}
role :db, %w{serverip:port}
# Extended Server Syntax
# ======================
# This can be used to drop a more detailed server
# definition into the server list. The second argument
# something that quacks like a hash can be used to set
# extended properties on the server.
server 'serverip:port', user: 'deploy', roles: %w{web app db}
set :deploy_to, "/home/deploy/projectnaam/production"
set :rails_env, 'production' # If the environment differs from the stage name
set :branch, 'master'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment