diff options
| author | mo khan <mo@mokhan.ca> | 2013-10-24 22:13:04 -0600 |
|---|---|---|
| committer | mo khan <mo@mokhan.ca> | 2013-10-24 22:13:04 -0600 |
| commit | 0648fa48042f78ac1c6621f613107e86ca29b294 (patch) | |
| tree | 01a2944254b2a2651a5999f0bfe81c41a82624ab /lib/tasks | |
| parent | 7080febdc42ac8a8046314ed15781e9a5caa18bc (diff) | |
remove dead code.
Diffstat (limited to 'lib/tasks')
| -rw-r--r-- | lib/tasks/ci.rake | 7 | ||||
| -rw-r--r-- | lib/tasks/database.rake | 2 | ||||
| -rw-r--r-- | lib/tasks/deployment.rake | 13 |
3 files changed, 6 insertions, 16 deletions
diff --git a/lib/tasks/ci.rake b/lib/tasks/ci.rake index a65f7ed1..b6f6dc90 100644 --- a/lib/tasks/ci.rake +++ b/lib/tasks/ci.rake @@ -2,12 +2,7 @@ task :ci => ['db:migrate', 'db:test:prepare', 'spec', 'teaspoon'] namespace :ci do namespace :deploy do - task :staging do - now = Time.now - sh "git tag -a 'staging-#{now.strftime('%Y-%m-%d')}-#{now.to_i}-jenkins-continuous-deployment' -m 'just push it'" - sh "git push --tags" - Rake::Task['deploy:staging'].invoke - end + task :staging => ['deploy:staging'] task :production => ['deploy:production'] end end diff --git a/lib/tasks/database.rake b/lib/tasks/database.rake index 16038fb3..61c3914c 100644 --- a/lib/tasks/database.rake +++ b/lib/tasks/database.rake @@ -7,10 +7,12 @@ namespace :db do sh "psql #{destination_db} < #{dumpfile}" #sh "pg_restore --verbose --clean --no-acl --no-owner -h localhost -U #{config[Rails.env]["username"]} -d #{destination_db} #{dumpfile}" end + task :backup do sh "cap production postgresql:backup" sh "rm -f latest && ln -s db/backups/`ls -rt db/backups/ | tail -n1` latest" end + task :restore_to_staging => :backup do sh "cap staging postgresql:restore" end diff --git a/lib/tasks/deployment.rake b/lib/tasks/deployment.rake index 266d9147..7e91c748 100644 --- a/lib/tasks/deployment.rake +++ b/lib/tasks/deployment.rake @@ -1,21 +1,14 @@ namespace :deploy do - desc "deploy to staging server" task :staging do sh "cap staging deploy:migrations" - sh "cap staging deploy:cleanup" sh "curl http://staging.cakeside.com/ > /dev/null" end desc "deploy to production server" - task :production, :tag do |t, args| - tag_to_deploy = args.tag - if tag_to_deploy.blank? - sh "cap production deploy:migrations" - else - sh "cap production deploy:migrations -s tag=#{tag_to_deploy}" - end - sh "curl http://cakeside.com/ > /dev/null" + task :production do + sh "cap production deploy:migrations" + sh "curl http://www.cakeside.com/ > /dev/null" end end |
