2020-07-08 08:09:33 -04:00
|
|
|
# frozen_string_literal: true
|
|
|
|
module Packages
|
|
|
|
module Maven
|
2020-09-03 08:08:47 -04:00
|
|
|
class CreatePackageService < ::Packages::CreatePackageService
|
2020-07-08 08:09:33 -04:00
|
|
|
def execute
|
|
|
|
app_group, _, app_name = params[:name].rpartition('/')
|
|
|
|
app_group.tr!('/', '.')
|
|
|
|
|
2020-09-03 08:08:47 -04:00
|
|
|
package = create_package!(:maven,
|
2020-07-08 08:09:33 -04:00
|
|
|
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
|