class DTK::Client::Operation::Module::Publish
Attributes
module_ref[R]
target_repo_dir[R]
version[R]
Public Class Methods
execute(args = Args.new)
click to toggle source
# File lib/client/operation/module/publish.rb, line 30 def self.execute(args = Args.new) wrap_operation(args) do |args| module_ref = args.required(:module_ref) base_dsl_file_obj = args.required(:base_dsl_file_obj) directory_path = args[:directory_path] update_lock_file = args[:update_lock_file] new('dtkn', module_ref, directory_path).publish({file_obj: base_dsl_file_obj, update_lock_file: update_lock_file}) end end
new(catalog, module_ref, directory_path)
click to toggle source
# File lib/client/operation/module/publish.rb, line 22 def initialize(catalog, module_ref, directory_path) @catalog = catalog @module_ref = module_ref @target_repo_dir = directory_path || module_ref.client_dir_path @version = module_ref.version end
Public Instance Methods
publish(opts = {})
click to toggle source
# File lib/client/operation/module/publish.rb, line 40 def publish(opts = {}) file_obj = opts[:file_obj] parsed_module = file_obj.parse_content(:common_module_summary) module_info = { name: module_ref.module_name, namespace: module_ref.namespace, version: @version, repo_dir: @target_repo_dir } response = DtkNetworkClient::Publish.run(module_info, parsed_module: parsed_module, development_mode: Config[:development_mode], update_lock_file: opts[:update_lock_file]) OsUtil.print_info("Module '#{module_ref.pretty_print}' has been published successfully.") if Config[:development_mode] ret_response = { namespace_id: response['namespace_short_id'], module_version_id: response['short_id'] } return ret_response end nil end