hoppinger 1.0.5 → 1.0.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.
- checksums.yaml +4 -4
- data/README.md +9 -0
- data/lib/generators/hoppinger/templates/cap.rb.erb +26 -0
- data/lib/hoppinger/version.rb +1 -1
- data/spec/lib/generators/cap_generator_spec.rb +26 -0
- data/spec/lib/hoppinger/cli_spec.rb +8 -0
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d15598cbfe343d03d76dd58e827ab1ebe236a8aa
|
4
|
+
data.tar.gz: eaa25be2ddf3c73a69b3d0eb2017559f6eb809ca
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d00013e8916ce274879eecd2a3bef090f1f531ff7766a87144f0de9f7623c44da64004a1bb5f36ac4531bd8e3a12fa34c1f92dc8501533da20fd814976d44735
|
7
|
+
data.tar.gz: eaa3ba2cd360a56a2ccb95e9a29b38bf109d930d178b967a6386da9247c93383a17f83c8eb1cc11cce0797f7719ce2127d5428e1bb9a717bf89ba2634429f700
|
data/README.md
CHANGED
@@ -42,6 +42,15 @@ In order to tail the logs
|
|
42
42
|
|
43
43
|
bundle exec cap staging logs:tail
|
44
44
|
|
45
|
+
In order to start the rails console
|
46
|
+
|
47
|
+
bundle exec cap staging run:console
|
48
|
+
|
49
|
+
## Planned
|
50
|
+
|
51
|
+
In order to run a rake task
|
52
|
+
|
53
|
+
bundle exec cap staging run:rake notes
|
45
54
|
|
46
55
|
## Contributing
|
47
56
|
|
@@ -22,6 +22,32 @@ namespace :logs do
|
|
22
22
|
end
|
23
23
|
end
|
24
24
|
|
25
|
+
namespace :run do
|
26
|
+
desc 'Run rails console'
|
27
|
+
task :console do
|
28
|
+
on roles(:app) do |host|
|
29
|
+
execute_interactively "ruby #{current_path}/script/rails console #{fetch(:rails_env)}"
|
30
|
+
end
|
31
|
+
end
|
32
|
+
|
33
|
+
desc 'Run rake task'
|
34
|
+
task :rake do
|
35
|
+
on roles(:app) do
|
36
|
+
within release_path do
|
37
|
+
with rails_env: fetch(:rails_env) do
|
38
|
+
execute :rake, 'notes'
|
39
|
+
end
|
40
|
+
end
|
41
|
+
end
|
42
|
+
end
|
43
|
+
end
|
44
|
+
|
45
|
+
def execute_interactively(command)
|
46
|
+
user = fetch(:user)
|
47
|
+
port = fetch(:port) || 22
|
48
|
+
exec "ssh -l #{user} #{host} -p #{port} -t 'cd #{deploy_to}/current && #{command}'"
|
49
|
+
end
|
50
|
+
|
25
51
|
def remote_database_config(db)
|
26
52
|
remote_config = capture("cat #{shared_path}/config/database.yml")
|
27
53
|
database = YAML::load(remote_config)
|
data/lib/hoppinger/version.rb
CHANGED
@@ -39,6 +39,32 @@ describe CapGenerator, type: :generator do
|
|
39
39
|
end
|
40
40
|
end
|
41
41
|
|
42
|
+
namespace :run do
|
43
|
+
desc 'Run rails console'
|
44
|
+
task :console do
|
45
|
+
on roles(:app) do |host|
|
46
|
+
execute_interactively "ruby \#{current_path}/script/rails console \#{fetch(:rails_env)}"
|
47
|
+
end
|
48
|
+
end
|
49
|
+
|
50
|
+
desc 'Run rake task'
|
51
|
+
task :rake do
|
52
|
+
on roles(:app) do
|
53
|
+
within release_path do
|
54
|
+
with rails_env: fetch(:rails_env) do
|
55
|
+
execute :rake, 'notes'
|
56
|
+
end
|
57
|
+
end
|
58
|
+
end
|
59
|
+
end
|
60
|
+
end
|
61
|
+
|
62
|
+
def execute_interactively(command)
|
63
|
+
user = fetch(:user)
|
64
|
+
port = fetch(:port) || 22
|
65
|
+
exec "ssh -l \#{user} \#{host} -p \#{port} -t 'cd \#{deploy_to}/current && \#{command}'"
|
66
|
+
end
|
67
|
+
|
42
68
|
def remote_database_config(db)
|
43
69
|
remote_config = capture("cat \#{shared_path}/config/database.yml")
|
44
70
|
database = YAML::load(remote_config)
|