Class: Action::Project::Rebuild

Inherits:
Object
  • Object
show all
Includes:
SetProjectAndBranch, InchCI::Action
Defined in:
app/services/action/project/rebuild.rb

Instance Method Summary collapse

Methods included from SetProjectAndBranch

#set_project_and_branch

Methods included from InchCI::Action

#exposures, included

Constructor Details

#initialize(params) ⇒ Rebuild

Returns a new instance of Rebuild.


11
12
13
14
15
16
17
# File 'app/services/action/project/rebuild.rb', line 11

def initialize(params)
  set_project_and_branch(params)
  if @project && @branch    # maybe we should check of there is a build running for this branch?

    @build = InchCI::Worker::Project::Build.enqueue(@project.repo_url, @branch.name)
  end
end

Instance Method Details

#build_idObject


19
20
21
# File 'app/services/action/project/rebuild.rb', line 19

def build_id
  @build.id
end

#success?Boolean

Returns:

  • (Boolean)

23
24
25
# File 'app/services/action/project/rebuild.rb', line 23

def success?
  !@build.nil?
end