deploku 0.0.4 → 0.0.5
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.
- checksums.yaml +4 -4
- data/lib/deploku/remote.rb +23 -14
- data/lib/deploku/runnable.rb +4 -1
- data/lib/deploku/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f66e41e5f13aa5aae9cc5db54d8a3e1d99132fd0
|
4
|
+
data.tar.gz: 9ab0c6aeb7aa1a8c598321466eaac0c1d751b316
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: da9940536231252b567d946e6ce4c811451669d8568d15090e9493aba0e4f44a7d8e1e2e1153c6d60143539d5e80e5172bafbe3fe9aa116c01b7ac0f06621423
|
7
|
+
data.tar.gz: 9e5490986ff92e315f1aa13d86498ca26f4df35934a7e5468f942d3abf567dfad4ce36796c396b78f8efee7c3d632f3b2d038dda29d79b5baeb41c4355f2a2a1
|
data/lib/deploku/remote.rb
CHANGED
@@ -10,7 +10,7 @@ module Deploku
|
|
10
10
|
end
|
11
11
|
|
12
12
|
def app_name
|
13
|
-
@app_name ||= run_command("git remote -v | grep #{remote} | grep push").match(/heroku
|
13
|
+
@app_name ||= run_command("git remote -v | grep #{remote} | grep push").match(/heroku[^:]*:(.*)\.git/)[1]
|
14
14
|
end
|
15
15
|
|
16
16
|
def remote_commit_exists_locally?
|
@@ -20,7 +20,7 @@ module Deploku
|
|
20
20
|
|
21
21
|
def database_configured?
|
22
22
|
return @database_configured if defined? @database_configured
|
23
|
-
@database_configured = test_command("rake db:migrate:status")
|
23
|
+
@database_configured = test_command("bundle exec rake db:migrate:status")
|
24
24
|
end
|
25
25
|
|
26
26
|
def behind
|
@@ -91,17 +91,26 @@ module Deploku
|
|
91
91
|
deploy_commands.each_with_index do |command, index|
|
92
92
|
puts " #{index + 1}. #{command}"
|
93
93
|
end
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
94
|
+
repeat = true
|
95
|
+
while repeat
|
96
|
+
repeat = false
|
97
|
+
print "\nChoose:\nD = deploy, or\nL = list commits to deploy, or\nanything else to abort: "
|
98
|
+
proceed = STDIN.getch.upcase
|
99
|
+
puts proceed
|
100
|
+
if proceed == "D"
|
101
|
+
puts ""
|
102
|
+
deploy_commands.each_with_index do |command, index|
|
103
|
+
puts " #{index + 1}. #{command} ..."
|
104
|
+
run_command command
|
105
|
+
end
|
106
|
+
puts
|
107
|
+
elsif proceed == "L"
|
108
|
+
puts "\nList of commits between #{remote_commit.slice(0, 7)} and local branch\n"
|
109
|
+
run_command "git log --oneline #{remote_commit}..", :echo
|
110
|
+
repeat = true
|
111
|
+
else
|
112
|
+
puts "Abort"
|
101
113
|
end
|
102
|
-
puts
|
103
|
-
else
|
104
|
-
puts "Abort"
|
105
114
|
end
|
106
115
|
end
|
107
116
|
|
@@ -161,7 +170,7 @@ module Deploku
|
|
161
170
|
end
|
162
171
|
|
163
172
|
def local_migrations
|
164
|
-
@local_migrations ||= extract_migrations(run_command("rake db:migrate:status"), :local)
|
173
|
+
@local_migrations ||= extract_migrations(run_command("bundle exec rake db:migrate:status"), :local)
|
165
174
|
end
|
166
175
|
|
167
176
|
def remote_migrations
|
@@ -184,4 +193,4 @@ module Deploku
|
|
184
193
|
|
185
194
|
end
|
186
195
|
|
187
|
-
end
|
196
|
+
end
|
data/lib/deploku/runnable.rb
CHANGED
@@ -1,10 +1,13 @@
|
|
1
1
|
module Deploku
|
2
2
|
module Runnable
|
3
3
|
|
4
|
-
def run_command(command)
|
4
|
+
def run_command(command, option = nil)
|
5
5
|
Bundler.with_clean_env {
|
6
6
|
out = `#{command}`
|
7
7
|
if $?.success?
|
8
|
+
if option == :echo
|
9
|
+
puts out
|
10
|
+
end
|
8
11
|
out
|
9
12
|
else
|
10
13
|
puts "Error running command:"
|
data/lib/deploku/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: deploku
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Bill Horsman
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2015-02-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|