From 530439b374e18fda6c6d6b81e07d2e6f304785ba Mon Sep 17 00:00:00 2001 From: mo khan Date: Fri, 9 Aug 2013 11:41:57 -0600 Subject: create cap task to tail the server logs --- config/deploy.rb | 3 +++ 1 file changed, 3 insertions(+) (limited to 'config/deploy.rb') diff --git a/config/deploy.rb b/config/deploy.rb index 0ac0220..81b74a3 100644 --- a/config/deploy.rb +++ b/config/deploy.rb @@ -9,6 +9,8 @@ load "config/recipes/nodejs" load "config/recipes/rbenv" load "config/recipes/newrelic" load "config/recipes/monit" +# general tasks +load "config/recipes/server" set :application, "parley" set :user, "deployer" @@ -29,3 +31,4 @@ after "deploy", "deploy:cleanup" # keep only the last 5 releases # cap deploy:setup # cap deploy:cold # cap nginx:start # this may be necessary if it didn't start up properly before + -- cgit v1.2.3 From 8eee6727265617955a1839ef2f8c69d9fe75db36 Mon Sep 17 00:00:00 2001 From: mo khan Date: Fri, 9 Aug 2013 14:29:23 -0600 Subject: add descriptions to the database backup/restore tasks --- config/deploy.rb | 2 +- config/recipes/server.rb | 4 ---- config/recipes/utility.rb | 4 ++++ lib/tasks/db.rake | 3 ++- 4 files changed, 7 insertions(+), 6 deletions(-) delete mode 100644 config/recipes/server.rb create mode 100644 config/recipes/utility.rb (limited to 'config/deploy.rb') diff --git a/config/deploy.rb b/config/deploy.rb index 81b74a3..d6a52e2 100644 --- a/config/deploy.rb +++ b/config/deploy.rb @@ -10,7 +10,7 @@ load "config/recipes/rbenv" load "config/recipes/newrelic" load "config/recipes/monit" # general tasks -load "config/recipes/server" +load "config/recipes/utility" set :application, "parley" set :user, "deployer" diff --git a/config/recipes/server.rb b/config/recipes/server.rb deleted file mode 100644 index 6d71371..0000000 --- a/config/recipes/server.rb +++ /dev/null @@ -1,4 +0,0 @@ -desc "tail the logs on an app server (cap qa logs)" -task :logs, roles: :app do - stream "tail -f #{shared_path}/log/#{rails_env}.log" -end diff --git a/config/recipes/utility.rb b/config/recipes/utility.rb new file mode 100644 index 0000000..6d71371 --- /dev/null +++ b/config/recipes/utility.rb @@ -0,0 +1,4 @@ +desc "tail the logs on an app server (cap qa logs)" +task :logs, roles: :app do + stream "tail -f #{shared_path}/log/#{rails_env}.log" +end diff --git a/lib/tasks/db.rake b/lib/tasks/db.rake index 6bb4bcb..38fb2c5 100644 --- a/lib/tasks/db.rake +++ b/lib/tasks/db.rake @@ -1,12 +1,13 @@ require "yaml" namespace :db do - desc 'backup database (rake db:backup["production"]' + desc 'backup database (rake db:backup["prod"])' task :backup, :env do |key, value| environment = value[:env] || 'qa' sh "cap #{environment} postgresql:backup" end + desc 'restore database to local' task :restore, :env do |key, value| environment = value[:env] || 'development' all_configuration = YAML.load_file(File.join(File.dirname(__FILE__), '../../config/database.yml' )) -- cgit v1.2.3