capstrap 0.3.2 → 0.3.3
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/CHANGELOG.markdown +6 -0
- data/Gemfile.lock +1 -1
- data/lib/capistrano/ext/capstrap/apt.rb +11 -0
- data/lib/capistrano/ext/capstrap/core.rb +6 -0
- data/lib/capstrap/cli.rb +39 -22
- data/lib/capstrap/version.rb +1 -1
- metadata +4 -4
data/CHANGELOG.markdown
CHANGED
data/Gemfile.lock
CHANGED
@@ -15,6 +15,14 @@ module Capstrap
|
|
15
15
|
end
|
16
16
|
|
17
17
|
namespace :apt do
|
18
|
+
desc "Resynchronizes the package index files."
|
19
|
+
task :update do
|
20
|
+
unless @updated
|
21
|
+
apt_update
|
22
|
+
@updated = true
|
23
|
+
end
|
24
|
+
end
|
25
|
+
|
18
26
|
namespace :install do
|
19
27
|
desc "Installs packages for running RVM"
|
20
28
|
task :rvm_depends do
|
@@ -33,6 +41,9 @@ module Capstrap
|
|
33
41
|
end
|
34
42
|
end
|
35
43
|
end
|
44
|
+
|
45
|
+
before "apt:install:rvm_depends", "apt:update"
|
46
|
+
before "apt:install:mri_depends", "apt:update"
|
36
47
|
end
|
37
48
|
end
|
38
49
|
end
|
data/lib/capstrap/cli.rb
CHANGED
@@ -13,42 +13,50 @@ module Capstrap
|
|
13
13
|
end
|
14
14
|
|
15
15
|
desc "ruby HOST", "Install an RVM ruby on remote SSH host HOST"
|
16
|
-
method_option "default", :type => :boolean, :desc =>
|
17
|
-
"Set this ruby to be RVM default."
|
18
16
|
def ruby(ssh_host)
|
19
|
-
|
20
|
-
|
21
|
-
|
17
|
+
track_time do
|
18
|
+
@ssh_host = ssh_host
|
19
|
+
setup_config options
|
20
|
+
exec_ruby
|
21
|
+
end
|
22
22
|
end
|
23
23
|
|
24
24
|
desc "chef HOST", "Install chef gem on remote SSH host HOST"
|
25
25
|
def chef(ssh_host)
|
26
|
-
|
27
|
-
|
28
|
-
|
26
|
+
track_time do
|
27
|
+
@ssh_host = ssh_host
|
28
|
+
setup_config options
|
29
|
+
exec_chef
|
30
|
+
end
|
29
31
|
end
|
30
32
|
|
31
33
|
desc "solo HOST", "Install chef cookbooks & config on remote SSH host HOST"
|
32
34
|
def solo(ssh_host)
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
35
|
+
track_time do
|
36
|
+
@ssh_host = ssh_host
|
37
|
+
setup_config options
|
38
|
+
assert_repos_set
|
39
|
+
exec_solo
|
40
|
+
end
|
37
41
|
end
|
38
42
|
|
39
43
|
desc "execute HOST", "Executes chef solo config on remote SSH host HOST"
|
40
44
|
def execute(ssh_host)
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
+
track_time do
|
46
|
+
@ssh_host = ssh_host
|
47
|
+
setup_config options
|
48
|
+
assert_repos_set
|
49
|
+
exec_execute
|
50
|
+
end
|
45
51
|
end
|
46
52
|
|
47
53
|
desc "update HOST", "Updates and executes chef solo on remote SSH host HOST"
|
48
54
|
def update(ssh_host)
|
49
|
-
|
50
|
-
|
51
|
-
|
55
|
+
track_time do
|
56
|
+
@ssh_host = ssh_host
|
57
|
+
setup_config options
|
58
|
+
exec_update
|
59
|
+
end
|
52
60
|
end
|
53
61
|
|
54
62
|
[:ruby, :chef, :solo, :execute, :update].each do |task|
|
@@ -107,9 +115,7 @@ module Capstrap
|
|
107
115
|
|
108
116
|
def exec_ruby
|
109
117
|
config.find_and_execute_task "rvm:install:#{config.fetch(:ruby)}"
|
110
|
-
|
111
|
-
config.find_and_execute_task "rvm:default:#{config.fetch(:ruby)}"
|
112
|
-
end
|
118
|
+
config.find_and_execute_task "rvm:default:#{config.fetch(:ruby)}"
|
113
119
|
end
|
114
120
|
|
115
121
|
def exec_chef
|
@@ -176,5 +182,16 @@ module Capstrap
|
|
176
182
|
config.set(var[:sym], options[var[:opt]])
|
177
183
|
end
|
178
184
|
end
|
185
|
+
|
186
|
+
def track_time(&block)
|
187
|
+
start = Time.now
|
188
|
+
yield
|
189
|
+
elapsed = Time.now - start
|
190
|
+
if elapsed < 60.0
|
191
|
+
puts "\n\n * Elapsed time: #{(Time.now - start)} seconds.\n"
|
192
|
+
else
|
193
|
+
puts "\n\n * Elapsed time: #{(Time.now - start) / 60.0} minutes.\n"
|
194
|
+
end
|
195
|
+
end
|
179
196
|
end
|
180
197
|
end
|
data/lib/capstrap/version.rb
CHANGED
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: capstrap
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 21
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 3
|
9
|
-
-
|
10
|
-
version: 0.3.
|
9
|
+
- 3
|
10
|
+
version: 0.3.3
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Fletcher Nichol
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2010-
|
18
|
+
date: 2010-12-10 00:00:00 -07:00
|
19
19
|
default_executable:
|
20
20
|
dependencies:
|
21
21
|
- !ruby/object:Gem::Dependency
|