ssc 0.4.3 → 0.4.4
Sign up to get free protection for your applications and to get access to all the features.
- data/VERSION +1 -1
- data/lib/handlers/appliance.rb +1 -0
- data/lib/handlers/build.rb +20 -8
- data/lib/handlers/helper.rb +2 -2
- data/lib/ssc.rb +9 -8
- data/ssc.gemspec +2 -2
- metadata +3 -3
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.4.
|
1
|
+
0.4.4
|
data/lib/handlers/appliance.rb
CHANGED
@@ -18,6 +18,7 @@ module SSC
|
|
18
18
|
appliance_dir= ApplianceDirectory.new(appliance_name, appliance_params)
|
19
19
|
appliance_dir.create
|
20
20
|
say_array(["Created: ", appliance_dir.path] + appliance_dir.files.values)
|
21
|
+
say "" # make sure terminal output starts on a new line
|
21
22
|
end
|
22
23
|
|
23
24
|
desc "appliance list", "list all appliances"
|
data/lib/handlers/build.rb
CHANGED
@@ -4,15 +4,15 @@ module SSC
|
|
4
4
|
|
5
5
|
default_task :build
|
6
6
|
|
7
|
-
desc "build", "
|
7
|
+
desc "build", "Builds an appliance.\n\nAccepted image types: oem, iso, xen, vmx"
|
8
8
|
require_appliance_id
|
9
|
-
method_option :image_type, :type => :string
|
9
|
+
method_option :image_type, :type => :string, :default => "iso"
|
10
10
|
def build
|
11
11
|
require_appliance_directory do |appliance, files|
|
12
12
|
if appliance.status.state != "ok"
|
13
13
|
raise Thor::Error, "Appliance is not OK. Please fix before building.\n#{appliance.status.issues.join("\n")}\n"
|
14
14
|
else
|
15
|
-
build = StudioApi::RunningBuild.new(:appliance_id => appliance.id, :image_type => options.image_type)
|
15
|
+
build = StudioApi::RunningBuild.new(:appliance_id => appliance.id, :image_type => options.image_type, :force => true)
|
16
16
|
build.save
|
17
17
|
config_file= File.join(Dir.pwd, '.sscrc')
|
18
18
|
if File.exists?(config_file)
|
@@ -31,9 +31,9 @@ module SSC
|
|
31
31
|
require_authorization
|
32
32
|
require_build_id
|
33
33
|
def status
|
34
|
-
build = StudioApi::
|
35
|
-
|
36
|
-
say "
|
34
|
+
build = StudioApi::RunningBuild.find options.build_id
|
35
|
+
say "Build Status: #{build.state}"
|
36
|
+
say "#{build.percent}% completed" if build.state == "running"
|
37
37
|
end
|
38
38
|
|
39
39
|
desc "list", "list builds (running or completed)"
|
@@ -45,12 +45,24 @@ module SSC
|
|
45
45
|
else
|
46
46
|
StudioApi::Build.find(:all, :params => {:appliance_id => options.appliance_id})
|
47
47
|
end
|
48
|
+
|
48
49
|
say "Build List:\n"
|
49
|
-
|
50
|
-
|
50
|
+
builds_info = builds.collect{ |i|
|
51
|
+
[i.id, "v#{i.version}", i.state, format_download_url(i)]
|
52
|
+
}
|
53
|
+
|
54
|
+
print_table([["id", "version", "state", "download link"]]+ builds_info)
|
51
55
|
end
|
52
56
|
|
57
|
+
private
|
53
58
|
|
59
|
+
def format_download_url build
|
60
|
+
if build.respond_to?(:download_url)
|
61
|
+
build.download_url
|
62
|
+
else
|
63
|
+
"n\\a"
|
64
|
+
end
|
65
|
+
end
|
54
66
|
end
|
55
67
|
end
|
56
68
|
end
|
data/lib/handlers/helper.rb
CHANGED
@@ -16,9 +16,9 @@ module SSC
|
|
16
16
|
def require_authorization
|
17
17
|
config= get_config
|
18
18
|
method_option :username, :type => :string, :required => true,
|
19
|
-
:default => config["username"]
|
19
|
+
:default => config["username"], :aliases => "-u"
|
20
20
|
method_option :password, :type => :string, :required => true,
|
21
|
-
:default => config["password"]
|
21
|
+
:default => config["password"], :aliases => "-p"
|
22
22
|
method_option :proxy, :type => :string
|
23
23
|
method_option :timeout, :type => :string
|
24
24
|
end
|
data/lib/ssc.rb
CHANGED
@@ -86,14 +86,6 @@ module SSC
|
|
86
86
|
:appliance_id => options.appliance_id,
|
87
87
|
:username => options.username,
|
88
88
|
:password => options.password}
|
89
|
-
# Add, Remove, Ban and Unban Packages
|
90
|
-
package_file= PackageFile.new
|
91
|
-
["add", "remove", "ban", "unban"].each do |action|
|
92
|
-
while package= package_file.pop(action)
|
93
|
-
invoke "s_s_c:handler:package:#{action}", [package], params
|
94
|
-
end
|
95
|
-
end
|
96
|
-
package_file.save
|
97
89
|
|
98
90
|
# Add or Remove Repositories
|
99
91
|
repository_file= RepositoryFile.new
|
@@ -104,6 +96,15 @@ module SSC
|
|
104
96
|
end
|
105
97
|
repository_file.save
|
106
98
|
|
99
|
+
# Add, Remove, Ban and Unban Packages
|
100
|
+
package_file= PackageFile.new
|
101
|
+
["add", "remove", "ban", "unban"].each do |action|
|
102
|
+
while package= package_file.pop(action)
|
103
|
+
invoke "s_s_c:handler:package:#{action}", [package], params
|
104
|
+
end
|
105
|
+
end
|
106
|
+
package_file.save
|
107
|
+
|
107
108
|
# Add Overlay Files
|
108
109
|
file_list = FileListFile.new
|
109
110
|
while file= file_list.pop("add")
|
data/ssc.gemspec
CHANGED
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{ssc}
|
8
|
-
s.version = "0.4.
|
8
|
+
s.version = "0.4.4"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Ratan Sebastian"]
|
12
|
-
s.date = %q{2011-09-
|
12
|
+
s.date = %q{2011-09-13}
|
13
13
|
s.default_executable = %q{ssc}
|
14
14
|
s.description = %q{Command-line client for Suse Studio}
|
15
15
|
s.email = %q{rjsvaljean@gmail.com}
|
metadata
CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
|
|
5
5
|
segments:
|
6
6
|
- 0
|
7
7
|
- 4
|
8
|
-
-
|
9
|
-
version: 0.4.
|
8
|
+
- 4
|
9
|
+
version: 0.4.4
|
10
10
|
platform: ruby
|
11
11
|
authors:
|
12
12
|
- Ratan Sebastian
|
@@ -14,7 +14,7 @@ autorequire:
|
|
14
14
|
bindir: bin
|
15
15
|
cert_chain: []
|
16
16
|
|
17
|
-
date: 2011-09-
|
17
|
+
date: 2011-09-13 00:00:00 +02:00
|
18
18
|
default_executable: ssc
|
19
19
|
dependencies:
|
20
20
|
- !ruby/object:Gem::Dependency
|