geordi 0.11.0 → 0.12.0
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/.gitignore +2 -0
- data/README.md +2 -2
- data/bin/dump-for +20 -1
- data/lib/geordi/version.rb +1 -1
- metadata +6 -6
data/.gitignore
CHANGED
data/README.md
CHANGED
@@ -75,9 +75,9 @@ More information at https://makandracards.com/makandra/7971-shell-script-to-depl
|
|
75
75
|
dump-for
|
76
76
|
--------
|
77
77
|
|
78
|
-
Dumps the database on your server for a given [Capistrano multistage](https://github.com/capistrano/capistrano/wiki/2.x-Multistage-Extension) deployment target.
|
78
|
+
Dumps the database on your server for a given [Capistrano multistage](https://github.com/capistrano/capistrano/wiki/2.x-Multistage-Extension) deployment target. Passing the -s option automatically sources the dump ito your development database.
|
79
79
|
|
80
|
-
dump-for production
|
80
|
+
dump-for production [-s]
|
81
81
|
|
82
82
|
More information at http://makandracards.com/makandra/1237-script-to-create-and-copy-a-production-dump-to-your-project-root
|
83
83
|
|
data/bin/dump-for
CHANGED
@@ -9,10 +9,29 @@ catching_errors do
|
|
9
9
|
success = system command
|
10
10
|
|
11
11
|
if success
|
12
|
+
source_path = "~/dumps/dump_for_download.dump"
|
13
|
+
destination_path = "#{root}/tmp/#{env}.dump"
|
14
|
+
|
12
15
|
puts "Downloading dump_for_download..."
|
13
|
-
system "scp #{user}@#{server}
|
16
|
+
system "scp #{user}@#{server}:#{source_path} #{destination_path}"
|
14
17
|
puts
|
15
18
|
puts "Dumped the #{env.upcase} database to: #{File.basename root}/tmp/#{env}.dump"
|
19
|
+
|
20
|
+
# source dump if option was given
|
21
|
+
if ARGV.include?("-s")
|
22
|
+
puts "Sourcing dump into development database..."
|
23
|
+
if File.exists?("script/dbconsole")
|
24
|
+
`script/dbconsole -p < #{destination_path}`
|
25
|
+
else
|
26
|
+
`rails db < #{destination_path}`
|
27
|
+
end
|
28
|
+
|
29
|
+
if $?.to_i == 0
|
30
|
+
puts "Your database is now sourced with a fresh #{env} dump."
|
31
|
+
else
|
32
|
+
puts "Could not source the downloaded #{env} dump."
|
33
|
+
end
|
34
|
+
end
|
16
35
|
else
|
17
36
|
raise "An error occurred. Aborting..."
|
18
37
|
end
|
data/lib/geordi/version.rb
CHANGED
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: geordi
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
5
|
-
prerelease:
|
4
|
+
hash: 47
|
5
|
+
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
|
-
-
|
8
|
+
- 12
|
9
9
|
- 0
|
10
|
-
version: 0.
|
10
|
+
version: 0.12.0
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Henning Koch
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2012-04-
|
18
|
+
date: 2012-04-13 00:00:00 +02:00
|
19
19
|
default_executable:
|
20
20
|
dependencies: []
|
21
21
|
|
@@ -108,7 +108,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
108
108
|
requirements: []
|
109
109
|
|
110
110
|
rubyforge_project: geordi
|
111
|
-
rubygems_version: 1.3.
|
111
|
+
rubygems_version: 1.3.9.4
|
112
112
|
signing_key:
|
113
113
|
specification_version: 3
|
114
114
|
summary: Collection of command line tools we use in our daily work with Ruby, Rails and Linux at makandra.
|