Class: Ci::RunScheduledBuildService

Inherits:
Object
  • Object
show all
Defined in:
app/services/ci/run_scheduled_build_service.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(build) ⇒ RunScheduledBuildService

Returns a new instance of RunScheduledBuildService.



5
6
7
# File 'app/services/ci/run_scheduled_build_service.rb', line 5

def initialize(build)
  @build = build
end

Instance Attribute Details

#buildObject (readonly)

Returns the value of attribute build.



15
16
17
# File 'app/services/ci/run_scheduled_build_service.rb', line 15

def build
  @build
end

Instance Method Details

#executeObject



9
10
11
12
13
# File 'app/services/ci/run_scheduled_build_service.rb', line 9

def execute
  raise Gitlab::Access::AccessDeniedError unless Ability.allowed?(build.user, :play_job, build)

  build.enqueue_scheduled!
end