452c076a34
This reverts commit 13e37a3ee5
.
18 lines
417 B
Ruby
18 lines
417 B
Ruby
require_relative 'base_service'
|
|
|
|
class CreateDeploymentService < BaseService
|
|
def execute(deployable = nil)
|
|
environment = project.environments.find_or_create_by(
|
|
name: params[:environment]
|
|
)
|
|
|
|
project.deployments.create(
|
|
environment: environment,
|
|
ref: params[:ref],
|
|
tag: params[:tag],
|
|
sha: params[:sha],
|
|
user: current_user,
|
|
deployable: deployable
|
|
)
|
|
end
|
|
end
|