Class: Omnibus::Config
- Inherits:
-
Object
- Object
- Omnibus::Config
- Extended by:
- Mixlib::Config, Util
- Defined in:
- lib/omnibus/config.rb
Overview
Write a Yard handler for Mixlib::Config-style DSL methods. I’d like the default value to show up in the docs without having to type it out twice, which I’m doing now for benefit of viewers of the Yard docs.
Global configuration object for Omnibus runs.
Constant Summary
Constants included from Util
Directory Configuration Parameters collapse
-
#base_dir ⇒ String
The “base” directory where Omnibus will store it’s data.
-
#build_dir ⇒ String
The absolute path to the directory on the virtual machine where software will be built.
-
#cache_dir ⇒ String
The absolute path to the directory on the virtual machine where code will be cached.
-
#install_dir ⇒ String
Installation directory.
-
#install_path_cache_dir ⇒ String
The absolute path to the directory on the virtual machine where install paths will be progressively cached.
-
#package_dir ⇒ String
The absolute path to the directory on the virtual machine where packages will be constructed.
-
#package_tmp ⇒ String
The absolute path to the directory on the virtual machine where packagers will store intermediate packaging products.
-
#project_dir ⇒ String
The relative path of the directory containing Project DSL files.
- #project_root ⇒ String
-
#software_dir ⇒ String
The relative path of the directory containing Software DSL files.
-
#source_dir ⇒ String
The absolute path to the directory on the virtual machine where source code will be downloaded.
DMG / PKG configuration options collapse
-
#build_dmg ⇒ Object
Package OSX pkg files inside a DMG.
-
#dmg_pkg_position ⇒ Object
Indicate the starting x,y position where the .pkg file should live in the DMG window.
-
#dmg_window_bounds ⇒ Object
Indicate the starting x,y and ending x,y positions for the created DMG window.
-
#sign_pkg ⇒ Boolean
Sign the pkg package.
-
#signing_identity ⇒ String
The identity to sign the pkg with.
S3 Caching Configuration Parameters collapse
-
#s3_access_key ⇒ String?
The S3 access key to use with S3 caching.
-
#s3_bucket ⇒ String?
The name of the S3 bucket you want to cache software artifacts in.
-
#s3_secret_key ⇒ String?
The S3 secret key to use with S3 caching.
-
#use_s3_caching ⇒ Boolean
Indicate if you wish to cache software artifacts in S3 for quicker build times.
S3 Release Parameters collapse
-
#release_s3_access_key ⇒ String?
The S3 access key to use for S3 artifact release.
-
#release_s3_bucket ⇒ String?
The name of the S3 bucket you want to release artifacts to.
-
#release_s3_secret_key ⇒ String?
The S3 secret key to use for S3 artifact release.
Miscellaneous Configuration Parameters collapse
- #override_file ⇒ Boolean
-
#software_gem ⇒ String?
The gem to pull software definitions from.
- #solaris_compiler ⇒ String?
Build Version Parameters collapse
-
#append_timestamp ⇒ Boolean
Append the current timestamp to the version identifier.
Validation Methods collapse
- .valid_s3_config? ⇒ Boolean
-
.validate ⇒ void
Asserts that the Config object is in a valid state.
Methods included from Util
falsey?, shellout, shellout!, truthy?, windows_safe_path
Instance Attribute Details
#append_timestamp ⇒ Boolean
Append the current timestamp to the version identifier.
281 |
# File 'lib/omnibus/config.rb', line 281 default :append_timestamp, true |
#base_dir ⇒ String
The “base” directory where Omnibus will store it’s data. Other paths are dynamically constructed from this value.
Defaults to ‘“C:omnibus-ruby”` on Windows Defaults to `“/var/cache/omnibus”` on other platforms
40 41 42 43 44 45 46 |
# File 'lib/omnibus/config.rb', line 40 default(:base_dir) do if Ohai.platform == 'windows' 'C:\\omnibus-ruby' else '/var/cache/omnibus' end end |
#build_dir ⇒ String
The absolute path to the directory on the virtual machine where software will be built.
Defaults to ‘“/var/cache/omnibus/build”`.
82 |
# File 'lib/omnibus/config.rb', line 82 default(:build_dir) { windows_safe_path(base_dir, 'build') } |
#build_dmg ⇒ Object
Package OSX pkg files inside a DMG
150 |
# File 'lib/omnibus/config.rb', line 150 default :build_dmg, true |
#cache_dir ⇒ String
The absolute path to the directory on the virtual machine where code will be cached.
Defaults to ‘“/var/cache/omnibus/cache”`.
55 |
# File 'lib/omnibus/config.rb', line 55 default(:cache_dir) { windows_safe_path(base_dir, 'cache') } |
#dmg_pkg_position ⇒ Object
Indicate the starting x,y position where the .pkg file should live in the DMG window.
164 |
# File 'lib/omnibus/config.rb', line 164 default :dmg_pkg_position, '535, 50' |
#dmg_window_bounds ⇒ Object
Indicate the starting x,y and ending x,y positions for the created DMG window.
157 |
# File 'lib/omnibus/config.rb', line 157 default :dmg_window_bounds, '100, 100, 750, 600' |
#install_dir ⇒ String
This appears to be unused, and actually conflated with Project#install_path
Installation directory
Defaults to ‘“/opt/chef”`.
140 |
# File 'lib/omnibus/config.rb', line 140 default :install_dir, '/opt/chef' |
#install_path_cache_dir ⇒ String
The absolute path to the directory on the virtual machine where install paths will be progressively cached.
Defaults to ‘“/var/cache/omnibus/cache/install_path”`.
64 |
# File 'lib/omnibus/config.rb', line 64 default(:install_path_cache_dir) { windows_safe_path(base_dir, 'cache', 'install_path') } |
#override_file ⇒ Boolean
255 |
# File 'lib/omnibus/config.rb', line 255 default :override_file, nil |
#package_dir ⇒ String
The absolute path to the directory on the virtual machine where packages will be constructed.
Defaults to ‘“/var/cache/omnibus/pkg”`.
91 |
# File 'lib/omnibus/config.rb', line 91 default(:package_dir) { windows_safe_path(base_dir, 'pkg') } |
#package_tmp ⇒ String
The absolute path to the directory on the virtual machine where packagers will store intermediate packaging products. Some packaging methods (notably fpm) handle this internally so not all packagers will use this setting.
Defaults to ‘“/var/cache/omnibus/pkg-tmp”`.
102 |
# File 'lib/omnibus/config.rb', line 102 default(:package_tmp) { windows_safe_path(base_dir, 'pkg-tmp') } |
#project_dir ⇒ String
The relative path of the directory containing Project DSL files. This is relative to #project_root.
Defaults to ‘“config/projects”`.
111 |
# File 'lib/omnibus/config.rb', line 111 default :project_dir, 'config/projects' |
#project_root ⇒ String
129 |
# File 'lib/omnibus/config.rb', line 129 default(:project_root) { Dir.pwd } |
#release_s3_access_key ⇒ String?
The S3 access key to use for S3 artifact release.
Defaults to ‘nil`. Must be set to use `release package` command.
238 |
# File 'lib/omnibus/config.rb', line 238 default :release_s3_access_key, nil |
#release_s3_bucket ⇒ String?
The name of the S3 bucket you want to release artifacts to.
Defaults to ‘nil`. Must be set to use `release package` command.
230 |
# File 'lib/omnibus/config.rb', line 230 default :release_s3_bucket, nil |
#release_s3_secret_key ⇒ String?
The S3 secret key to use for S3 artifact release
Defaults to ‘nil`. Must be set to use `release package` command.
246 |
# File 'lib/omnibus/config.rb', line 246 default :release_s3_secret_key, nil |
#s3_access_key ⇒ String?
The S3 access key to use with S3 caching.
Defaults to ‘nil`. Must be set if #use_s3_caching is `true`.
210 |
# File 'lib/omnibus/config.rb', line 210 default :s3_access_key, nil |
#s3_bucket ⇒ String?
The name of the S3 bucket you want to cache software artifacts in.
Defaults to ‘nil`. Must be set if #use_s3_caching is `true`.
202 |
# File 'lib/omnibus/config.rb', line 202 default :s3_bucket, nil |
#s3_secret_key ⇒ String?
The S3 secret key to use with S3 caching.
Defaults to ‘nil`. Must be set if #use_s3_caching is `true.`
218 |
# File 'lib/omnibus/config.rb', line 218 default :s3_secret_key, nil |
#sign_pkg ⇒ Boolean
Sign the pkg package.
Default is false.
172 |
# File 'lib/omnibus/config.rb', line 172 default :sign_pkg, false |
#signing_identity ⇒ String
The identity to sign the pkg with.
Default is nil. Required if sign_pkg is set.
180 |
# File 'lib/omnibus/config.rb', line 180 default :signing_identity, nil |
#software_dir ⇒ String
The relative path of the directory containing Software DSL files. This is relative #project_root.
Defaults to ‘“config/software”`.
120 |
# File 'lib/omnibus/config.rb', line 120 default :software_dir, 'config/software' |
#software_gem ⇒ String?
The gem to pull software definitions from. This is just the name of the gem, which is used to find the path to your software definitions, and you must also specify this gem in the Gemfile of your project repo in order to include the gem in your bundle.
Defaults to “omnibus-software”.
266 |
# File 'lib/omnibus/config.rb', line 266 default :software_gem, 'omnibus-software' |
#solaris_compiler ⇒ String?
271 |
# File 'lib/omnibus/config.rb', line 271 default :solaris_compiler, nil |
#source_dir ⇒ String
The absolute path to the directory on the virtual machine where source code will be downloaded.
Defaults to ‘“/var/cache/omnibus/src”`.
73 |
# File 'lib/omnibus/config.rb', line 73 default(:source_dir) { windows_safe_path(base_dir, 'src') } |
#use_s3_caching ⇒ Boolean
Indicate if you wish to cache software artifacts in S3 for quicker build times. Requires #s3_bucket, #s3_access_key, and #s3_secret_key to be set if this is set to ‘true`.
Defaults to ‘false`.
194 |
# File 'lib/omnibus/config.rb', line 194 default :use_s3_caching, false |
Class Method Details
.valid_s3_config? ⇒ Boolean
306 307 308 309 310 311 312 |
# File 'lib/omnibus/config.rb', line 306 def self.valid_s3_config? if use_s3_caching unless s3_bucket raise InvalidS3Configuration.new(s3_bucket, s3_access_key, s3_secret_key) end end end |
.validate ⇒ void
This method returns an undefined value.
Asserts that the Config object is in a valid state. If invalid for any reason, an exception will be thrown.
300 301 302 303 |
# File 'lib/omnibus/config.rb', line 300 def self.validate valid_s3_config? # add other validation methods as needed end |