class KPM::BaseInstaller
def install_plugin_from_fs(plugin_key, raw_file_path, name, version, bundles_dir = nil, type = 'java')
def install_plugin_from_fs(plugin_key, raw_file_path, name, version, bundles_dir = nil, type = 'java') # Expand glob if needed file_paths = Dir.glob(raw_file_path) raise ArgumentError, "Cannot install plugin: no file found at #{raw_file_path}" if file_paths.empty? raise ArgumentError, "Cannot install plugin: multiple files found at #{raw_file_path}" if file_paths.size > 1 file_path = file_paths[0] bundles_dir = Pathname.new(bundles_dir || DEFAULT_BUNDLES_DIR).expand_path plugins_dir = bundles_dir.join('plugins') version = Utils.get_version_from_file_path(file_path) if version.nil? raise ArgumentError, 'Cannot install plugin: missing version' if version.nil? if type.to_s == 'java' plugin_name = name.nil? ? Utils.get_plugin_name_from_file_path(file_path) : name destination = plugins_dir.join('java').join(plugin_name).join(version) else raise ArgumentError, "Aborting installation: plugin type #{type} unsupported" end artifact_info = KPM::KillbillPluginArtifact.pull_from_fs(@logger, file_path, destination) artifact_info[:version] ||= version mark_as_active(plugins_dir, artifact_info) update_plugin_identifier(plugins_dir, plugin_key, type.to_s, nil, artifact_info) # store trace info to be returned as JSON by the KPM::Installer.install method @trace_logger.add('plugins', plugin_key, artifact_info.merge('status' => 'INSTALLED')) artifact_info end