Class: DtcRake::Config
- Inherits:
-
Object
- Object
- DtcRake::Config
- Includes:
- Singleton
- Defined in:
- lib/dtc_rake/config.rb
Instance Attribute Summary collapse
-
#app ⇒ Object
Code of application.
-
#appbox_artifact_code ⇒ Object
Code of appbox artifact.
-
#appbox_location_code ⇒ Object
Code of appbox location (folder or organization unit).
-
#appbox_meta_artifact_code ⇒ Object
Code of appbox meta artifact.
-
#appbox_territory_code ⇒ Object
Code of territory where the appbox artifact is / should be.
-
#appbox_uarchive ⇒ Object
Path to uarchive with contents of appbox artifact.
-
#appbox_version ⇒ Object
Appbox version.
-
#colorize ⇒ Object
Print messages in colors.
-
#output_dir ⇒ Object
Name of folder with build products.
-
#product_code ⇒ Object
Code of product the appbox belongs to.
-
#product_name ⇒ Object
Name of product the appbox belongs to.
-
#root_dir ⇒ Object
Appbox project root folder.
-
#upload_readme ⇒ Object
Upload README.md or README.txt to appbox artifact.
-
#upload_uucloud_descriptor ⇒ Object
Upload uuApp deployment descriptor to appbox artifact.
-
#uucloud_descriptor_path ⇒ Object
Path to uuApp deployment descriptor.
-
#vendor ⇒ Object
Code of vendor.
-
#version_files ⇒ Object
List of files (or glob patterns) determining which files get updated by version:* tasks.
Instance Method Summary collapse
-
#initialize ⇒ Config
constructor
A new instance of Config.
- #validate! ⇒ Object
Constructor Details
#initialize ⇒ Config
Returns a new instance of Config.
15 16 17 18 19 20 21 22 23 24 |
# File 'lib/dtc_rake/config.rb', line 15 def initialize self.root_dir = Dir.pwd self.output_dir = "target" self.colorize = true self.upload_readme = false self. = "UU.OS/RUNTIME/APP_BOX" self.upload_uucloud_descriptor = false self.version_files = [] guess_vendor_and_app end |
Instance Attribute Details
#app ⇒ Object
Code of application. Guessed from root_dir name if not set.
27 28 29 |
# File 'lib/dtc_rake/config.rb', line 27 def app @app end |
#appbox_artifact_code ⇒ Object
Code of appbox artifact. Guessed from product_code and appbox_version if not set.
31 32 33 |
# File 'lib/dtc_rake/config.rb', line 31 def appbox_artifact_code @appbox_artifact_code end |
#appbox_location_code ⇒ Object
Code of appbox location (folder or organization unit). Required.
34 35 36 |
# File 'lib/dtc_rake/config.rb', line 34 def appbox_location_code @appbox_location_code end |
#appbox_meta_artifact_code ⇒ Object
Code of appbox meta artifact. Default value: UU.OS/RUNTIME/APP_BOX.
37 38 39 |
# File 'lib/dtc_rake/config.rb', line 37 def end |
#appbox_territory_code ⇒ Object
Code of territory where the appbox artifact is / should be. Required.
40 41 42 |
# File 'lib/dtc_rake/config.rb', line 40 def appbox_territory_code @appbox_territory_code end |
#appbox_uarchive ⇒ Object
Path to uarchive with contents of appbox artifact. Default value: nil. If not set, appbox is created with empty content. Relative path is relative to root_dir.
45 46 47 |
# File 'lib/dtc_rake/config.rb', line 45 def appbox_uarchive @appbox_uarchive end |
#appbox_version ⇒ Object
Appbox version. Read from VERSION file located in the same directory as Rakefile if not set.
49 50 51 |
# File 'lib/dtc_rake/config.rb', line 49 def appbox_version @appbox_version end |
#colorize ⇒ Object
Print messages in colors. Default value: true.
52 53 54 |
# File 'lib/dtc_rake/config.rb', line 52 def colorize @colorize end |
#output_dir ⇒ Object
Name of folder with build products. Default value: target. Relative path is relative to root_dir.
56 57 58 |
# File 'lib/dtc_rake/config.rb', line 56 def output_dir @output_dir end |
#product_code ⇒ Object
Code of product the appbox belongs to. Required.
59 60 61 |
# File 'lib/dtc_rake/config.rb', line 59 def product_code @product_code end |
#product_name ⇒ Object
Name of product the appbox belongs to. Required.
62 63 64 |
# File 'lib/dtc_rake/config.rb', line 62 def product_name @product_name end |
#root_dir ⇒ Object
Appbox project root folder. Default value: current working directory.
65 66 67 |
# File 'lib/dtc_rake/config.rb', line 65 def root_dir @root_dir end |
#upload_readme ⇒ Object
Upload README.md or README.txt to appbox artifact. Default value: false.
68 69 70 |
# File 'lib/dtc_rake/config.rb', line 68 def upload_readme @upload_readme end |
#upload_uucloud_descriptor ⇒ Object
Upload uuApp deployment descriptor to appbox artifact. Default value: false.
71 72 73 |
# File 'lib/dtc_rake/config.rb', line 71 def upload_uucloud_descriptor @upload_uucloud_descriptor end |
#uucloud_descriptor_path ⇒ Object
Path to uuApp deployment descriptor. Default value: uucloud_descriptor.json.
74 75 76 |
# File 'lib/dtc_rake/config.rb', line 74 def uucloud_descriptor_path @uucloud_descriptor_path end |
#vendor ⇒ Object
Code of vendor. Guessed from root_dir name if not set.
77 78 79 |
# File 'lib/dtc_rake/config.rb', line 77 def vendor @vendor end |
#version_files ⇒ Object
List of files (or glob patterns) determining which files get updated by version:* tasks. Default: none.
81 82 83 |
# File 'lib/dtc_rake/config.rb', line 81 def version_files @version_files end |
Instance Method Details
#validate! ⇒ Object
83 84 85 86 87 88 89 |
# File 'lib/dtc_rake/config.rb', line 83 def validate! %w(appbox_location_code appbox_territory_code product_code product_name).each do |param| if instance_variable_get("@#{param}").nil? _error "Required parameter #{param} is not set. Set it within DtcRake.configure in your Rakefile." end end end |