gitlab-org--gitlab-foss/app/services/create_deployment_service.rb
2016-06-16 12:59:07 +02:00

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