engineyard-eycap 0.4.3 → 0.4.4

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.4.4 / 2009-03-03
2
+ * happy square root day!
3
+ * fixed the *correct* database.rb file for the db:clone_prod_to_staging
4
+
1
5
  == 0.4.3 / 2009-02-11
2
6
  * updated db:dump command for Engine Yard Solo offering, fixing a bug where
3
7
  the dbname wasn't included.
@@ -13,32 +13,18 @@ Capistrano::Configuration.instance(:must_exist).load do
13
13
 
14
14
  # This task currently runs only on traditional EY offerings.
15
15
  # You need to have both a production and staging environment defined in
16
- # your deploy.rb file.
16
+ # your deploy.rb file.
17
17
 
18
18
  backup_name
19
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] }
21
-
22
- # If the production db hostname has a trailing -master string, substitute
23
- # it with -replica.
24
- # Elsif the production db hostname doesn't have a trailing -master, just
25
- # append -replica.
26
- # Else you're using PostgreSQL and we'll dump it that way.
20
+ run("cat #{shared_path}/config/database.yml") { |channel, stream, data| @environment_info = YAML.load(data)[rails_env] }
27
21
 
28
- if @environment_info['adapter'] == 'mysql' && production_dbhost.scan('-master') == true
29
- run "mysqldump --add-drop-table -u #{dbuser} -h #{production_dbhost.gsub('-master', '-replica')} #{production_database} -p > #{backup_file}" do |ch, stream, out|
30
- ch.send_data "#{dbpass}\n" if out=~ /^Enter password:/
31
- end
32
- run "mysql -u #{dbuser} -p -h #{staging_dbhost} #{staging_database} < #{backup_file}" do |ch, stream, out|
33
- ch.send_data "#{dbpass}\n" if out=~ /^Enter password:/
34
- end
35
- elsif @environment_info['adapter'] == 'mysql' && production_dbhost.scan('-master') != true
36
- run "mysqldump --add-drop-table -u #{dbuser} -h #{production_dbhost + '-replica'} #{production_database} -p > #{backup_file}" do |ch, stream, out|
22
+ if @environment_info['adapter'] == 'mysql'
23
+ dbhost = @environment_info['host']
24
+ dbhost = environment_dbhost.sub('-master', '') + '-replica' if dbhost != 'localhost' # added for Solo offering, which uses localhost
25
+ run "mysqldump --add-drop-table -u #{dbuser} -h #{dbhost} -p #{environment_database} | bzip2 -c > #{backup_file}.bz2" do |ch, stream, out |
37
26
  ch.send_data "#{dbpass}\n" if out=~ /^Enter password:/
38
27
  end
39
- run "mysql -u #{dbuser} -p -h #{staging_dbhost} #{staging_database} < #{backup_file}" do |ch, stream, out|
40
- ch.send_data "#{dbpass}\n" if out=~ /^Enter password:/
41
- end
42
28
  else
43
29
  run "pg_dump -W -c -U #{dbuser} -h #{production_dbhost} -f #{backup_file} #{production_database}" do |ch, stream, out|
44
30
  ch.send_data "#{dbpass}\n" if out=~ /^Password:/
data/lib/eycap.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Eycap
2
- VERSION = '0.4.3'
2
+ VERSION = '0.4.4'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: engineyard-eycap
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.3
4
+ version: 0.4.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Engine Yard