Class: Omnibus::Config

Inherits:
Object
  • Object
show all
Extended by:
Mixlib::Config, Util
Defined in:
lib/omnibus/config.rb

Overview

TODO:

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

Util::SHELLOUT_OPTIONS

Directory Configuration Parameters collapse

DMG / PKG configuration options collapse

S3 Caching Configuration Parameters collapse

S3 Release Parameters collapse

Miscellaneous Configuration Parameters collapse

Build Version Parameters collapse

Validation Methods collapse

Methods included from Util

falsey?, shellout, shellout!, truthy?, windows_safe_path

Instance Attribute Details

#append_timestampBoolean

Append the current timestamp to the version identifier.

Returns:

  • (Boolean)


281
# File 'lib/omnibus/config.rb', line 281

default :append_timestamp, true

#base_dirString

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

Returns:

  • (String)


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_dirString

The absolute path to the directory on the virtual machine where software will be built.

Defaults to ‘“/var/cache/omnibus/build”`.

Returns:

  • (String)


82
# File 'lib/omnibus/config.rb', line 82

default(:build_dir) { windows_safe_path(base_dir, 'build') }

#build_dmgObject

Package OSX pkg files inside a DMG



150
# File 'lib/omnibus/config.rb', line 150

default :build_dmg, true

#cache_dirString

The absolute path to the directory on the virtual machine where code will be cached.

Defaults to ‘“/var/cache/omnibus/cache”`.

Returns:

  • (String)


55
# File 'lib/omnibus/config.rb', line 55

default(:cache_dir) { windows_safe_path(base_dir, 'cache') }

#dmg_pkg_positionObject

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_boundsObject

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_dirString

TODO:

This appears to be unused, and actually conflated with Project#install_path

Installation directory

Defaults to ‘“/opt/chef”`.

Returns:

  • (String)


140
# File 'lib/omnibus/config.rb', line 140

default :install_dir, '/opt/chef'

#install_path_cache_dirString

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”`.

Returns:

  • (String)


64
# File 'lib/omnibus/config.rb', line 64

default(:install_path_cache_dir) { windows_safe_path(base_dir, 'cache', 'install_path') }

#override_fileBoolean

Returns:

  • (Boolean)


255
# File 'lib/omnibus/config.rb', line 255

default :override_file, nil

#package_dirString

The absolute path to the directory on the virtual machine where packages will be constructed.

Defaults to ‘“/var/cache/omnibus/pkg”`.

Returns:

  • (String)


91
# File 'lib/omnibus/config.rb', line 91

default(:package_dir) { windows_safe_path(base_dir, 'pkg') }

#package_tmpString

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”`.

Returns:

  • (String)


102
# File 'lib/omnibus/config.rb', line 102

default(:package_tmp) { windows_safe_path(base_dir, 'pkg-tmp') }

#project_dirString

The relative path of the directory containing Project DSL files. This is relative to #project_root.

Defaults to ‘“config/projects”`.

Returns:

  • (String)


111
# File 'lib/omnibus/config.rb', line 111

default :project_dir, 'config/projects'

#project_rootString

The root directory in which to look for Project and Software DSL files.

Defaults to the current working directory.

Returns:

  • (String)


129
# File 'lib/omnibus/config.rb', line 129

default(:project_root) { Dir.pwd }

#release_s3_access_keyString?

The S3 access key to use for S3 artifact release.

Defaults to ‘nil`. Must be set to use `release package` command.

Returns:

  • (String, nil)


238
# File 'lib/omnibus/config.rb', line 238

default :release_s3_access_key, nil

#release_s3_bucketString?

The name of the S3 bucket you want to release artifacts to.

Defaults to ‘nil`. Must be set to use `release package` command.

Returns:

  • (String, nil)


230
# File 'lib/omnibus/config.rb', line 230

default :release_s3_bucket, nil

#release_s3_secret_keyString?

The S3 secret key to use for S3 artifact release

Defaults to ‘nil`. Must be set to use `release package` command.

Returns:

  • (String, nil)


246
# File 'lib/omnibus/config.rb', line 246

default :release_s3_secret_key, nil

#s3_access_keyString?

The S3 access key to use with S3 caching.

Defaults to ‘nil`. Must be set if #use_s3_caching is `true`.

Returns:

  • (String, nil)


210
# File 'lib/omnibus/config.rb', line 210

default :s3_access_key, nil

#s3_bucketString?

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`.

Returns:

  • (String, nil)


202
# File 'lib/omnibus/config.rb', line 202

default :s3_bucket, nil

#s3_secret_keyString?

The S3 secret key to use with S3 caching.

Defaults to ‘nil`. Must be set if #use_s3_caching is `true.`

Returns:

  • (String, nil)


218
# File 'lib/omnibus/config.rb', line 218

default :s3_secret_key, nil

#sign_pkgBoolean

Sign the pkg package.

Default is false.

Returns:

  • (Boolean)


172
# File 'lib/omnibus/config.rb', line 172

default :sign_pkg, false

#signing_identityString

The identity to sign the pkg with.

Default is nil. Required if sign_pkg is set.

Returns:

  • (String)


180
# File 'lib/omnibus/config.rb', line 180

default :signing_identity, nil

#software_dirString

The relative path of the directory containing Software DSL files. This is relative #project_root.

Defaults to ‘“config/software”`.

Returns:

  • (String)


120
# File 'lib/omnibus/config.rb', line 120

default :software_dir, 'config/software'

#software_gemString?

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”.

Returns:

  • (String, nil)


266
# File 'lib/omnibus/config.rb', line 266

default :software_gem, 'omnibus-software'

#solaris_compilerString?

Returns:

  • (String, nil)


271
# File 'lib/omnibus/config.rb', line 271

default :solaris_compiler, nil

#source_dirString

The absolute path to the directory on the virtual machine where source code will be downloaded.

Defaults to ‘“/var/cache/omnibus/src”`.

Returns:

  • (String)


73
# File 'lib/omnibus/config.rb', line 73

default(:source_dir) { windows_safe_path(base_dir, 'src') }

#use_s3_cachingBoolean

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`.

Returns:

  • (Boolean)


194
# File 'lib/omnibus/config.rb', line 194

default :use_s3_caching, false

Class Method Details

.valid_s3_config?Boolean

Returns:

  • (Boolean)

Raises:



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

.validatevoid

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.

Raises:

  • (RuntimeError)


300
301
302
303
# File 'lib/omnibus/config.rb', line 300

def self.validate
  valid_s3_config?
  # add other validation methods as needed
end