tsukuru 0.3.1 → 0.4.0
Sign up to get free protection for your applications and to get access to all the features.
- data/VERSION +1 -1
- data/bin/tsukuru +16 -5
- metadata +3 -3
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.
|
1
|
+
0.4.0
|
data/bin/tsukuru
CHANGED
@@ -7,6 +7,7 @@ require 'ruby-unix-now'
|
|
7
7
|
require 'optparse'
|
8
8
|
require 'pathname'
|
9
9
|
require 'fileutils'
|
10
|
+
require 'yaml'
|
10
11
|
|
11
12
|
options = Struct.new(:capture, :local, :reindex, :app, :target, :current, :username, :password).new
|
12
13
|
|
@@ -125,15 +126,25 @@ db_file = options.current + 'db/pgdump.sql'
|
|
125
126
|
|
126
127
|
run :dropdb, options.app if `psql --list`.include?(options.app)
|
127
128
|
run :createdb, options.app
|
128
|
-
run :sed, "-i '' -E '
|
129
|
-
run :sed, "-i '' -E '
|
130
|
-
run :psql, :q, :f => db_file, :d => options.app
|
129
|
+
run :sed, "-i '' -E '/^ALTER .* OWNER/d'", db_file
|
130
|
+
run :sed, "-i '' -E '/^ALTER .* OWNED/d'", db_file
|
131
|
+
run :psql, :q, {:f => db_file, :d => options.app}, '> /dev/null'
|
131
132
|
|
132
133
|
database_config = options.current + 'config/database.yml'
|
133
134
|
if File.exist?(database_config)
|
134
|
-
|
135
|
+
puts 'Writing database configuration'
|
136
|
+
File.open(database_config, 'w') do |file|
|
137
|
+
config = {'fallback' => {
|
138
|
+
'adapter' => 'postgresql',
|
139
|
+
'host' => 'localhost',
|
140
|
+
'min_messages' => 'warning',
|
141
|
+
'encoding' =>'utf-8',
|
142
|
+
'timeout' => 5000,
|
143
|
+
'database' => options.app}}
|
144
|
+
file.puts(config.to_yaml)
|
145
|
+
end
|
135
146
|
end
|
136
|
-
in_app 'bundle install --without shell'
|
147
|
+
in_app 'bundle install --without shell --relock'
|
137
148
|
|
138
149
|
|
139
150
|
if options.reindex
|