devinstall 0.2.5 → 0.2.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/bin/pkg-tool +10 -1
- data/lib/devinstall/cli.rb +4 -1
- data/lib/devinstall/version.rb +1 -1
- data/lib/devinstall.rb +16 -6
- 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: 814187f402502bc1f4530dbe4c2a8b9ec8c24190
|
4
|
+
data.tar.gz: 9818041552ee6e73fbda4ed3e778e458472996e4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ad7dded5934b11adfb7715bb3c0cc0d97e4c758a509ff4f8b54d43b034641a356e796ea88219264882f3a8e59dd32ae9111234a7a6aa182e9aa29e81254399a3
|
7
|
+
data.tar.gz: 3468b12ee4269d3dd87ac3de83123b0d20b0403376e4a59a96dccdb098261e65d090521605c7b2713d2b8242f2667ac4cb47fa97c58a37016bab750daf35bf05
|
data/bin/pkg-tool
CHANGED
@@ -3,11 +3,20 @@
|
|
3
3
|
require 'devinstall/cli'
|
4
4
|
|
5
5
|
command = ARGV.shift
|
6
|
+
package = ''
|
6
7
|
|
7
8
|
unless %w"build install upload help version test".include? command
|
8
9
|
puts "Unknown command #{command}"
|
9
10
|
exit! 1
|
10
11
|
end
|
11
|
-
|
12
|
+
|
13
|
+
## the next should be the package
|
14
|
+
# so if ARGV[0] don't start with --
|
15
|
+
# we name it package
|
16
|
+
if ARGV[0][0..1] != '--'
|
17
|
+
package = ARGV.shift
|
18
|
+
end
|
19
|
+
|
20
|
+
cli=Devinstall::Cli.new(package)
|
12
21
|
cli.send(command.to_sym)
|
13
22
|
|
data/lib/devinstall/cli.rb
CHANGED
@@ -14,7 +14,7 @@ module Devinstall
|
|
14
14
|
@opt['config']
|
15
15
|
end
|
16
16
|
|
17
|
-
def initialize
|
17
|
+
def initialize(package)
|
18
18
|
begin
|
19
19
|
@opt = Getopt::Long.getopts(
|
20
20
|
['--package', '-p', Getopt::REQUIRED],
|
@@ -42,6 +42,9 @@ module Devinstall
|
|
42
42
|
# complete from default values
|
43
43
|
%w"package env type".each { |o| @opt[o] ||= Settings.defaults[o.to_sym] if Settings.defaults[o.to_sym] }
|
44
44
|
# verify all informations
|
45
|
+
if package != '' # a packege was supplied on commandline
|
46
|
+
@opt['package'] = package # this overrides all
|
47
|
+
end
|
45
48
|
%w"package type env".each do |k|
|
46
49
|
unless @opt[k]
|
47
50
|
puts "You must specify option '#{k}' either as default or in command line"
|
data/lib/devinstall/version.rb
CHANGED
data/lib/devinstall.rb
CHANGED
@@ -32,6 +32,11 @@ module Devinstall
|
|
32
32
|
# @param [String] package
|
33
33
|
def initialize (package)
|
34
34
|
# curently implemented only for .deb packages (for .rpm later :D)
|
35
|
+
unless Settings.packages.has_key? package.to_sym
|
36
|
+
puts "You required an undefined package #{package}"
|
37
|
+
puts "Aborting!"
|
38
|
+
exit! 1
|
39
|
+
end
|
35
40
|
@package = package.to_sym
|
36
41
|
@_package_version = Hash.new # versions for types:
|
37
42
|
@package_files = Hash.new
|
@@ -141,13 +146,18 @@ module Devinstall
|
|
141
146
|
end
|
142
147
|
install[k] = Settings.install[:environments][environment][k]
|
143
148
|
end
|
149
|
+
|
150
|
+
install[:host] = [install[:host]] unless Array === install[:host]
|
151
|
+
|
144
152
|
case type
|
145
|
-
|
146
|
-
|
147
|
-
command("#{
|
148
|
-
|
149
|
-
|
150
|
-
|
153
|
+
when :deb
|
154
|
+
install[:host].each do |host|
|
155
|
+
command("#{scp} #{local_temp}/#{@package_files[type][:deb]} #{install[:user]}@#{host}:#{install[:folder]}")
|
156
|
+
command("#{sudo} #{install[:user]}@#{host} /usr/bin/dpkg -i #{install[:folder]}/#{@package_files[type][:deb]}")
|
157
|
+
end
|
158
|
+
else
|
159
|
+
puts "unknown package type '#{type.to_s}'"
|
160
|
+
exit! 1
|
151
161
|
end
|
152
162
|
end
|
153
163
|
|