2020-07-28 23:09:34 +05:30
|
|
|
# frozen_string_literal: true
|
|
|
|
module Packages
|
|
|
|
module Maven
|
2020-11-24 15:15:51 +05:30
|
|
|
class CreatePackageService < ::Packages::CreatePackageService
|
2020-07-28 23:09:34 +05:30
|
|
|
def execute
|
|
|
|
app_group, _, app_name = params[:name].rpartition('/')
|
|
|
|
app_group.tr!('/', '.')
|
|
|
|
|
2020-11-24 15:15:51 +05:30
|
|
|
package = create_package!(:maven,
|
2020-07-28 23:09:34 +05:30
|
|
|
maven_metadatum_attributes: {
|
|
|
|
path: params[:path],
|
|
|
|
app_group: app_group,
|
|
|
|
app_name: app_name,
|
|
|
|
app_version: params[:version]
|
|
|
|
}
|
|
|
|
)
|
|
|
|
|
|
|
|
build = params[:build]
|
|
|
|
package.create_build_info!(pipeline: build.pipeline) if build.present?
|
|
|
|
|
|
|
|
package
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|