teleport 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.
- data/lib/teleport/install.rb +26 -14
- data/lib/teleport/main.rb +10 -1
- data/lib/teleport/version.rb +1 -1
- metadata +4 -4
data/lib/teleport/install.rb
CHANGED
@@ -23,6 +23,16 @@ module Teleport
|
|
23
23
|
@config.dsl.extend(Util)
|
24
24
|
@config.dsl.run_verbose!
|
25
25
|
|
26
|
+
# handle CONFIG_RECIPE
|
27
|
+
if @config_file[:recipe]
|
28
|
+
_with_callback(:install) do
|
29
|
+
_with_callback(:recipes) do
|
30
|
+
_recipe(@config_file[:recipe])
|
31
|
+
end
|
32
|
+
end
|
33
|
+
return
|
34
|
+
end
|
35
|
+
|
26
36
|
_with_callback(:install) do
|
27
37
|
_gems
|
28
38
|
_hostname
|
@@ -49,13 +59,13 @@ module Teleport
|
|
49
59
|
|
50
60
|
def _read_config
|
51
61
|
# read DIR/config to get CONFIG_HOST (and set @host)
|
52
|
-
config_file = { }
|
62
|
+
@config_file = { }
|
53
63
|
File.readlines("config").each do |i|
|
54
64
|
if i =~ /CONFIG_([^=]+)='([^']*)'/
|
55
|
-
config_file[$1.downcase.to_sym] = $2
|
65
|
+
@config_file[$1.downcase.to_sym] = $2
|
56
66
|
end
|
57
67
|
end
|
58
|
-
@host = config_file[:host]
|
68
|
+
@host = @config_file[:host]
|
59
69
|
|
60
70
|
# do we have a server object?
|
61
71
|
@server = @config.server(@host)
|
@@ -92,19 +102,21 @@ module Teleport
|
|
92
102
|
list += @server.recipes if @server
|
93
103
|
|
94
104
|
banner "Recipes..."
|
95
|
-
list.each
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
+
list.each { |i| _recipe(i) }
|
106
|
+
end
|
107
|
+
|
108
|
+
def _recipe(recipe)
|
109
|
+
path = "#{DATA}/recipes/#{recipe}"
|
110
|
+
if File.exists?(path)
|
111
|
+
banner "#{recipe}..."
|
112
|
+
# eval ruby files instead of running them
|
113
|
+
if path =~ /\.rb$/
|
114
|
+
eval(File.read(path), nil, path)
|
105
115
|
else
|
106
|
-
|
116
|
+
run path
|
107
117
|
end
|
118
|
+
else
|
119
|
+
fatal "Recipe '#{recipe}' does not exist inside recipes/"
|
108
120
|
end
|
109
121
|
end
|
110
122
|
|
data/lib/teleport/main.rb
CHANGED
@@ -33,6 +33,9 @@ module Teleport
|
|
33
33
|
o.on("-i", "--infer", "infer a new Telfile from YOUR machine") do |f|
|
34
34
|
@options[:cmd] = :infer
|
35
35
|
end
|
36
|
+
o.on("-r", "--recipe [RECIPE]", "run a single recipe instead of a full install") do |f|
|
37
|
+
@options[:recipe] = f
|
38
|
+
end
|
36
39
|
o.on_tail("-h", "--help", "print this help text") do
|
37
40
|
puts opt
|
38
41
|
exit(0)
|
@@ -63,6 +66,11 @@ module Teleport
|
|
63
66
|
fatal("Sadly, I can't find Telfile here. Please create one.")
|
64
67
|
end
|
65
68
|
@config = Config.new("Telfile")
|
69
|
+
|
70
|
+
# check if recipe exists
|
71
|
+
if @options[:recipe] && !File.exists?("recipes/#{@options[:recipe]}")
|
72
|
+
fatal "I couldn't find recipe #{@options[:recipe].inspect}. Oops."
|
73
|
+
end
|
66
74
|
end
|
67
75
|
|
68
76
|
# Assemble the the tgz before we teleport to the host
|
@@ -83,7 +91,8 @@ module Teleport
|
|
83
91
|
File.open("#{DIR}/config", "w") do |f|
|
84
92
|
f.puts("CONFIG_HOST='#{@options[:host]}'")
|
85
93
|
f.puts("CONFIG_RUBY='#{@config.ruby}'")
|
86
|
-
f.puts("CONFIG_RUBYGEMS='#{RUBYGEMS}'")
|
94
|
+
f.puts("CONFIG_RUBYGEMS='#{RUBYGEMS}'")
|
95
|
+
f.puts("CONFIG_RECIPE='#{@options[:recipe]}'") if @options[:recipe]
|
87
96
|
end
|
88
97
|
# keys
|
89
98
|
if ssh_key = @config.ssh_key
|
data/lib/teleport/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: teleport
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.6
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-04
|
12
|
+
date: 2012-05-04 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: amazon-ec2
|
@@ -136,7 +136,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
136
136
|
version: '0'
|
137
137
|
segments:
|
138
138
|
- 0
|
139
|
-
hash: -
|
139
|
+
hash: -2626968326399993902
|
140
140
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
141
141
|
none: false
|
142
142
|
requirements:
|
@@ -145,7 +145,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
145
145
|
version: '0'
|
146
146
|
segments:
|
147
147
|
- 0
|
148
|
-
hash: -
|
148
|
+
hash: -2626968326399993902
|
149
149
|
requirements: []
|
150
150
|
rubyforge_project: teleport
|
151
151
|
rubygems_version: 1.8.21
|