Class: TxghServer::Webhooks::Gitlab::StatusUpdater

Inherits:
TxghServer::Webhooks::Git::StatusUpdater show all
Defined in:
lib/txgh-server/webhooks/gitlab/status_updater.rb

Instance Attribute Summary

Attributes inherited from TxghServer::Webhooks::Git::StatusUpdater

#branch, #project, #repo

Instance Method Summary collapse

Methods inherited from TxghServer::Webhooks::Git::StatusUpdater

#initialize

Constructor Details

This class inherits a constructor from TxghServer::Webhooks::Git::StatusUpdater

Instance Method Details

#report_error_and_update_status(error) ⇒ Object



7
8
9
10
11
12
13
14
15
16
17
# File 'lib/txgh-server/webhooks/gitlab/status_updater.rb', line 7

def report_error_and_update_status(error)
  error_params = Txgh.events.publish_error!(error)

  Txgh.events.publish_each('gitlab.status.error', error_params) do |status_params|
    if status_params
      update_status_safely do
        Txgh::GitlabStatus.error(project, repo, branch, status_params)
      end
    end
  end
end

#update_statusObject



19
20
21
22
23
# File 'lib/txgh-server/webhooks/gitlab/status_updater.rb', line 19

def update_status
  update_status_safely do
    Txgh::GitlabStatus.update(project, repo, branch)
  end
end