eycap 0.5.5 → 0.5.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/History.txt CHANGED
@@ -1,3 +1,7 @@
1
+ == 0.5.6 / 2009-6-17
2
+ * updated bundler task so it won't install test or development gems
3
+ * updated database tasks - based on Tyler Poland's update
4
+
1
5
  == 0.5.5 / 2009-3-16
2
6
  * fixed 2 bugs that are in 0.5.4 with the SSL and bundler recipes
3
7
  * use this version with bundler version 0.9.2
data/lib/eycap.rb CHANGED
@@ -1,5 +1,3 @@
1
1
  module Eycap
2
-
3
- VERSION = '0.5.5'
4
-
2
+ VERSION = '0.5.6'
5
3
  end
@@ -63,7 +63,7 @@ module Capistrano
63
63
  self.close
64
64
 
65
65
  hooks = [:any]
66
- hooks << (self.successful? ? :success : :failure)
66
+ hooks << self.successful? ? :success : :failure
67
67
  puts "Executing Post Processing Hooks"
68
68
  hooks.each do |h|
69
69
  @_post_process_hooks[h].each do |key|
@@ -122,4 +122,4 @@ module Capistrano
122
122
  end
123
123
 
124
124
  end
125
- end
125
+ end
@@ -2,7 +2,7 @@ Capistrano::Configuration.instance(:must_exist).load do
2
2
  namespace :bundler do
3
3
  desc "Automatically installed your bundled gems if a Gemfile exists"
4
4
  task :bundle_gems do
5
- run "if [ -f #{release_path}/Gemfile ]; then cd #{release_path} && bundle install; fi"
5
+ run "if [ -f #{release_path}/Gemfile ]; then cd #{release_path} && bundle install --without=test,development; fi"
6
6
  end
7
7
  after "deploy:symlink_configs","bundler:bundle_gems"
8
8
  end
@@ -12,45 +12,39 @@ Capistrano::Configuration.instance(:must_exist).load do
12
12
  task :clone_prod_to_staging, :roles => :db, :only => { :primary => true } do
13
13
 
14
14
  # This task currently runs only on traditional EY offerings.
15
- # You need to have both a production and staging environment defined in
16
- # your deploy.rb file.
15
+ # You need to have both a production and staging environment defined in
16
+ # your deploy.rb file.
17
17
 
18
- backup_name
19
- on_rollback { run "rm -f #{backup_file}" }
20
- run("cat #{shared_path}/config/database.yml") { |channel, stream, data| @environment_info = YAML.load(data)[rails_env] }
18
+ backup_name unless exists?(:backup_file)
19
+ run("cat #{shared_path}/config/database.yml") { |channel, stream, data| @environment_info = YAML.load(data)[rails_env] }
20
+ dump
21
21
 
22
22
  if @environment_info['adapter'] == 'mysql'
23
- dbhost = @environment_info['host']
24
- dbhost = environment_dbhost.sub('-master', '') + '-replica'
25
- run "mysqldump --add-drop-table -u #{dbuser} -h #{dbhost} -p #{environment_database} | bzip2 -c > #{backup_file}.bz2" do |ch, stream, out |
26
- ch.send_data "#{dbpass}\n" if out=~ /^Enter password:/
27
- end
28
- run "bzcat #{backup_file}.bz2 | mysql -u #{dbuser} -p -h #{staging_dbhost} #{staging_database}" do |ch, stream, out|
23
+ run "gunzip < #{backup_file}.gz | mysql -u #{dbuser} -p -h #{staging_dbhost} #{staging_database}" do |ch, stream, out|
29
24
  ch.send_data "#{dbpass}\n" if out=~ /^Enter password:/
30
25
  end
31
26
  else
32
- run "pg_dump -W -c -U #{dbuser} -h #{production_dbhost} #{production_database} | bzip2 -c > #{backup_file}.bz2" do |ch, stream, out|
33
- ch.send_data "#{dbpass}\n" if out=~ /^Password:/
34
- end
35
- run "bzcat #{backup_file}.bz2 | psql -W -U #{dbuser} -h #{staging_dbhost} #{staging_database}" do |ch, stream, out|
27
+ run "gunzip < #{backup_file}.gz | psql -W -U #{dbuser} -h #{staging_dbhost} #{staging_database}" do |ch, stream, out|
36
28
  ch.send_data "#{dbpass}\n" if out=~ /^Password/
37
29
  end
38
30
  end
39
- run "rm -f #{backup_file}.bz2"
31
+ run "rm -f #{backup_file}.gz"
40
32
  end
41
33
 
42
34
  desc "Backup your MySQL or PostgreSQL database to shared_path+/db_backups"
43
35
  task :dump, :roles => :db, :only => {:primary => true} do
44
- backup_name
36
+ backup_name unless exists?(:backup_file)
37
+ on_rollback { run "rm -f #{backup_file}" }
45
38
  run("cat #{shared_path}/config/database.yml") { |channel, stream, data| @environment_info = YAML.load(data)[rails_env] }
39
+
46
40
  if @environment_info['adapter'] == 'mysql'
47
41
  dbhost = @environment_info['host']
48
42
  dbhost = environment_dbhost.sub('-master', '') + '-replica' if dbhost != 'localhost' # added for Solo offering, which uses localhost
49
- run "mysqldump --add-drop-table -u #{dbuser} -h #{dbhost} -p #{environment_database} | bzip2 -c > #{backup_file}.bz2" do |ch, stream, out |
43
+ run "mysqldump --add-drop-table -u #{dbuser} -h #{dbhost} -p #{environment_database} | gzip -c > #{backup_file}.gz" do |ch, stream, out |
50
44
  ch.send_data "#{dbpass}\n" if out=~ /^Enter password:/
51
45
  end
52
46
  else
53
- run "pg_dump -W -c -U #{dbuser} -h #{environment_dbhost} #{environment_database} | bzip2 -c > #{backup_file}.bz2" do |ch, stream, out |
47
+ run "pg_dump -W -c -U #{dbuser} -h #{environment_dbhost} #{environment_database} | gzip -c > #{backup_file}.gz" do |ch, stream, out |
54
48
  ch.send_data "#{dbpass}\n" if out=~ /^Password:/
55
49
  end
56
50
  end
@@ -58,17 +52,18 @@ Capistrano::Configuration.instance(:must_exist).load do
58
52
 
59
53
  desc "Sync your production database to your local workstation"
60
54
  task :clone_to_local, :roles => :db, :only => {:primary => true} do
61
- backup_name
55
+ backup_name unless exists?(:backup_file)
62
56
  dump
63
- get "#{backup_file}.bz2", "/tmp/#{application}.sql.bz2"
57
+ get "#{backup_file}.gz", "/tmp/#{application}.sql.gz"
64
58
  development_info = YAML.load_file("config/database.yml")['development']
65
59
  if development_info['adapter'] == 'mysql'
66
- run_str = "bzcat /tmp/#{application}.sql.bz2 | mysql -u #{development_info['username']} --password='#{development_info['password']}' -h #{development_info['host']} #{development_info['database']}"
60
+ run_str = "gunzip < /tmp/#{application}.sql.gz | mysql -u #{development_info['username']} --password='#{development_info['password']}' -h #{development_info['host']} #{development_info['database']}"
67
61
  else
68
- run_str = "PGPASSWORD=#{development_info['password']} bzcat /tmp/#{application}.sql.bz2 | psql -U #{development_info['username']} -h #{development_info['host']} #{development_info['database']}"
62
+ run_str = "PGPASSWORD=#{development_info['password']} gunzip < /tmp/#{application}.sql.gz | psql -U #{development_info['username']} -h #{development_info['host']} #{development_info['database']}"
69
63
  end
70
64
  %x!#{run_str}!
65
+ run "rm -f #{backup_file}.gz"
71
66
  end
72
67
  end
73
68
 
74
- end
69
+ end
@@ -1,15 +1,15 @@
1
1
  Capistrano::Configuration.instance(:must_exist).load do
2
2
 
3
3
  namespace :slice do
4
- desc "Tail the Rails logs for your environment"
5
- task :tail_environment_logs, :roles => :app do
4
+ desc "Tail the Rails production log for this environment"
5
+ task :tail_production_logs, :roles => :app do
6
6
  run "tail -f #{shared_path}/log/#{rails_env}.log" do |channel, stream, data|
7
7
  puts # for an extra line break before the host name
8
8
  puts "#{channel[:server]} -> #{data}"
9
9
  break if stream == :err
10
10
  end
11
11
  end
12
- desc "Tail the Mongrel logs for your environment"
12
+ desc "Tail the Mongrel logs this environment"
13
13
  task :tail_mongrel_logs, :roles => :app do
14
14
  run "tail -f #{shared_path}/log/mongrel*.log" do |channel, stream, data|
15
15
  puts # for an extra line break before the host name
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 5
8
- - 5
9
- version: 0.5.5
8
+ - 6
9
+ version: 0.5.6
10
10
  platform: ruby
11
11
  authors:
12
12
  - Engine Yard