debian-mirror-gitlab/app/services/create_deployment_service.rb
2016-06-16 23:09:34 +05:30

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