Class: DtcRake::Product
- Inherits:
-
Object
- Object
- DtcRake::Product
- Includes:
- UI, Singleton
- Defined in:
- lib/dtc_rake/product.rb
Instance Attribute Summary collapse
-
#appbox_uri ⇒ Object
readonly
UESURI of the appbox artifact.
-
#cmd_attachment_code ⇒ Object
readonly
Returns the value of attribute cmd_attachment_code.
-
#cmd_file_name ⇒ Object
readonly
Returns the value of attribute cmd_file_name.
-
#cmd_project ⇒ Object
readonly
Returns the value of attribute cmd_project.
-
#dockerfiles_attachment_code ⇒ Object
readonly
Returns the value of attribute dockerfiles_attachment_code.
-
#dockerfiles_file_name ⇒ Object
readonly
Returns the value of attribute dockerfiles_file_name.
-
#dockerfiles_project ⇒ Object
readonly
Returns the value of attribute dockerfiles_project.
-
#gem_attachment_code ⇒ Object
readonly
Returns the value of attribute gem_attachment_code.
-
#gem_file_name ⇒ Object
readonly
Returns the value of attribute gem_file_name.
-
#gem_project ⇒ Object
readonly
Returns the value of attribute gem_project.
-
#has_cmd ⇒ Object
readonly
Returns the value of attribute has_cmd.
-
#has_dockerfiles ⇒ Object
readonly
Returns the value of attribute has_dockerfiles.
-
#has_gem ⇒ Object
readonly
Returns the value of attribute has_gem.
-
#has_vuc ⇒ Object
readonly
Returns the value of attribute has_vuc.
-
#version ⇒ Object
readonly
Appbox version specified in deployment descriptor.
-
#vuc_attachment_code ⇒ Object
readonly
Returns the value of attribute vuc_attachment_code.
-
#vuc_file_name ⇒ Object
readonly
Returns the value of attribute vuc_file_name.
-
#vuc_project ⇒ Object
readonly
Returns the value of attribute vuc_project.
-
#yardoc_attachment_code ⇒ Object
readonly
Returns the value of attribute yardoc_attachment_code.
-
#yardoc_file_name ⇒ Object
readonly
Returns the value of attribute yardoc_file_name.
Instance Method Summary collapse
-
#initialize ⇒ Product
constructor
A new instance of Product.
- #readme_attachment_code ⇒ Object
- #uucloud_descriptor ⇒ Object
- #uucloud_descriptor_attachment_code ⇒ Object
Methods included from UI
announce, colorize?, error, info, success, warning
Constructor Details
#initialize ⇒ Product
Returns a new instance of Product.
25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 |
# File 'lib/dtc_rake/product.rb', line 25 def initialize config = Config.instance root_dir = config.root_dir sibling_dir_path = File.(File.join(root_dir, "../#{config.vendor}_#{config.app}")) @gem_project = sibling_dir_path @has_gem = File.directory?(@gem_project) @cmd_project = "#{sibling_dir_path}-cmd" @has_cmd = File.directory?(@cmd_project) @vuc_project = "#{sibling_dir_path}-vuc" @has_vuc = File.directory?(@vuc_project) @dockerfiles_project = File.(File.join(root_dir, "../docker")) @has_dockerfiles = File.directory?(@dockerfiles_project) end |
Instance Attribute Details
#appbox_uri ⇒ Object (readonly)
UESURI of the appbox artifact.
16 17 18 |
# File 'lib/dtc_rake/product.rb', line 16 def appbox_uri @appbox_uri end |
#cmd_attachment_code ⇒ Object (readonly)
Returns the value of attribute cmd_attachment_code.
23 24 25 |
# File 'lib/dtc_rake/product.rb', line 23 def @cmd_attachment_code end |
#cmd_file_name ⇒ Object (readonly)
Returns the value of attribute cmd_file_name.
22 23 24 |
# File 'lib/dtc_rake/product.rb', line 22 def cmd_file_name @cmd_file_name end |
#cmd_project ⇒ Object (readonly)
Returns the value of attribute cmd_project.
18 19 20 |
# File 'lib/dtc_rake/product.rb', line 18 def cmd_project @cmd_project end |
#dockerfiles_attachment_code ⇒ Object (readonly)
Returns the value of attribute dockerfiles_attachment_code.
23 24 25 |
# File 'lib/dtc_rake/product.rb', line 23 def @dockerfiles_attachment_code end |
#dockerfiles_file_name ⇒ Object (readonly)
Returns the value of attribute dockerfiles_file_name.
22 23 24 |
# File 'lib/dtc_rake/product.rb', line 22 def dockerfiles_file_name @dockerfiles_file_name end |
#dockerfiles_project ⇒ Object (readonly)
Returns the value of attribute dockerfiles_project.
18 19 20 |
# File 'lib/dtc_rake/product.rb', line 18 def dockerfiles_project @dockerfiles_project end |
#gem_attachment_code ⇒ Object (readonly)
Returns the value of attribute gem_attachment_code.
23 24 25 |
# File 'lib/dtc_rake/product.rb', line 23 def @gem_attachment_code end |
#gem_file_name ⇒ Object (readonly)
Returns the value of attribute gem_file_name.
22 23 24 |
# File 'lib/dtc_rake/product.rb', line 22 def gem_file_name @gem_file_name end |
#gem_project ⇒ Object (readonly)
Returns the value of attribute gem_project.
18 19 20 |
# File 'lib/dtc_rake/product.rb', line 18 def gem_project @gem_project end |
#has_cmd ⇒ Object (readonly)
Returns the value of attribute has_cmd.
20 21 22 |
# File 'lib/dtc_rake/product.rb', line 20 def has_cmd @has_cmd end |
#has_dockerfiles ⇒ Object (readonly)
Returns the value of attribute has_dockerfiles.
20 21 22 |
# File 'lib/dtc_rake/product.rb', line 20 def has_dockerfiles @has_dockerfiles end |
#has_gem ⇒ Object (readonly)
Returns the value of attribute has_gem.
20 21 22 |
# File 'lib/dtc_rake/product.rb', line 20 def has_gem @has_gem end |
#has_vuc ⇒ Object (readonly)
Returns the value of attribute has_vuc.
20 21 22 |
# File 'lib/dtc_rake/product.rb', line 20 def has_vuc @has_vuc end |
#version ⇒ Object (readonly)
Appbox version specified in deployment descriptor.
13 14 15 |
# File 'lib/dtc_rake/product.rb', line 13 def version @version end |
#vuc_attachment_code ⇒ Object (readonly)
Returns the value of attribute vuc_attachment_code.
23 24 25 |
# File 'lib/dtc_rake/product.rb', line 23 def @vuc_attachment_code end |
#vuc_file_name ⇒ Object (readonly)
Returns the value of attribute vuc_file_name.
22 23 24 |
# File 'lib/dtc_rake/product.rb', line 22 def vuc_file_name @vuc_file_name end |
#vuc_project ⇒ Object (readonly)
Returns the value of attribute vuc_project.
18 19 20 |
# File 'lib/dtc_rake/product.rb', line 18 def vuc_project @vuc_project end |
#yardoc_attachment_code ⇒ Object (readonly)
Returns the value of attribute yardoc_attachment_code.
23 24 25 |
# File 'lib/dtc_rake/product.rb', line 23 def @yardoc_attachment_code end |
#yardoc_file_name ⇒ Object (readonly)
Returns the value of attribute yardoc_file_name.
22 23 24 |
# File 'lib/dtc_rake/product.rb', line 22 def yardoc_file_name @yardoc_file_name end |
Instance Method Details
#readme_attachment_code ⇒ Object
133 134 135 136 137 |
# File 'lib/dtc_rake/product.rb', line 133 def return @readme_attachment_code if defined? @readme_attachment_code config = Config.instance @readme_attachment_code = "#{config.vendor.upcase}.#{config.app.upcase}/README" end |
#uucloud_descriptor ⇒ Object
43 44 45 46 47 48 49 50 |
# File 'lib/dtc_rake/product.rb', line 43 def uucloud_descriptor return @uucloud_descriptor if @uucloud_descriptor # TODO: Use app.json instead of uucloud_descriptor.json for appbox metadata File.open(Config.instance.uucloud_descriptor_path, "r") do |f| @uucloud_descriptor = JSON.parse(f.read, symbolize_names: true) end end |
#uucloud_descriptor_attachment_code ⇒ Object
127 128 129 130 131 |
# File 'lib/dtc_rake/product.rb', line 127 def return @uucloud_descriptor_attachment_code if defined? @uucloud_descriptor_attachment_code config = Config.instance @uucloud_descriptor_attachment_code = "#{config.vendor.upcase}.#{config.app.upcase}/UUAPP-DEPLOY" end |