Class: Omnibus::CLI
Defined Under Namespace
Classes: Runner
Instance Method Summary
collapse
dispatch, #help, #initialize
Methods included from Logging
included
Instance Method Details
#build(name) ⇒ Object
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
|
# File 'lib/omnibus/cli.rb', line 78
def build(name)
manifest = if @options[:use_manifest]
Omnibus::Manifest.from_file(@options[:use_manifest])
else
nil
end
project = Project.load(name, manifest)
say("Building #{project.name} #{project.build_version}...")
Omnibus::S3Cache.populate if @options[:populate_s3_cache] && !Omnibus::S3Cache.fetch_missing.empty?
project.download
project.build
if @options[:output_manifest]
FileUtils.mkdir_p("pkg")
File.open(::File.join("pkg", "version-manifest.json"), "w") do |f|
f.write(FFI_Yajl::Encoder.encode(project.built_manifest.to_hash, pretty: true))
end
end
end
|
#list ⇒ Object
162
163
164
165
166
167
168
169
170
171
|
# File 'lib/omnibus/cli.rb', line 162
def list
if Omnibus.projects.empty?
say("There are no Omnibus projects!")
else
say("Omnibus projects:")
Omnibus.projects.sort.each do |project|
say(" * #{project.name} (#{project.build_version})")
end
end
end
|
#manifest(name) ⇒ Object
122
123
124
125
126
127
128
129
130
|
# File 'lib/omnibus/cli.rb', line 122
def manifest(name)
Ohai["os"] = @options[:os] if @options[:os]
Ohai["platform_family"] = @options[:platform_family] if @options[:platform_family]
Ohai["platform"] = @options[:platform] if @options[:platform]
Ohai["platform_version"] = @options[:platform_version] if @options[:platform_version]
Ohai["kernel"]["machine"] = @options[:architecture] if @options[:architecture]
puts FFI_Yajl::Encoder.encode(Project.load(name).built_manifest.to_hash, pretty: true)
end
|
#version ⇒ Object
187
188
189
|
# File 'lib/omnibus/cli.rb', line 187
def version
say("Omnibus v#{Omnibus::VERSION}")
end
|