Class: VexorCiService
- Inherits:
-
Service
- Object
- Service
- VexorCiService
- Defined in:
- lib/vx/gitlab_status_service/vexor_ci_service.rb
Overview
Schema Information
Table name: services
id :integer not null, primary key
type :string(255)
title :string(255)
token :string(255)
project_id :integer not null
created_at :datetime not null
updated_at :datetime not null
active :boolean default(FALSE), not null
project_url :string(255)
subdomain :string(255)
room :string(255)
api_key :string(255)
Instance Method Summary collapse
- #build_page(sha) ⇒ Object
- #builds_path ⇒ Object
- #commit_status(sha) ⇒ Object
- #commit_status_path(sha) ⇒ Object
- #description ⇒ Object
- #execute(push_data) ⇒ Object
- #fields ⇒ Object
- #status_img_path ⇒ Object
- #title ⇒ Object
- #to_param ⇒ Object
Instance Method Details
#build_page(sha) ⇒ Object
39 40 41 |
# File 'lib/vx/gitlab_status_service/vexor_ci_service.rb', line 39 def build_page(sha) project_url + "/builds/sha/#{sha}" end |
#builds_path ⇒ Object
43 44 45 |
# File 'lib/vx/gitlab_status_service/vexor_ci_service.rb', line 43 def builds_path "" end |
#commit_status(sha) ⇒ Object
29 30 31 32 33 34 35 36 37 |
# File 'lib/vx/gitlab_status_service/vexor_ci_service.rb', line 29 def commit_status(sha) response = HTTParty.get(commit_status_path(sha), verify: false) if response.code == 200 && response["status"] response["status"] else :error end end |
#commit_status_path(sha) ⇒ Object
25 26 27 |
# File 'lib/vx/gitlab_status_service/vexor_ci_service.rb', line 25 def commit_status_path(sha) project_url + "/api/builds/sha/#{sha}.json?token=#{token}" end |
#description ⇒ Object
56 57 58 |
# File 'lib/vx/gitlab_status_service/vexor_ci_service.rb', line 56 def description "Continuous integration server from Vexor" end |
#execute(push_data) ⇒ Object
71 72 73 |
# File 'lib/vx/gitlab_status_service/vexor_ci_service.rb', line 71 def execute(push_data) # NOOP end |
#fields ⇒ Object
64 65 66 67 68 69 |
# File 'lib/vx/gitlab_status_service/vexor_ci_service.rb', line 64 def fields [ { type: "text", name: "token", placeholder: "Vexor CI project specific token" }, { type: "text", name: "project_url", placeholder: "http://ci.vexor.io/projects/3"} ] end |
#status_img_path ⇒ Object
47 48 49 50 |
# File 'lib/vx/gitlab_status_service/vexor_ci_service.rb', line 47 def status_img_path # project_url + "/status.png?ref=" + project.default_branch "" end |
#title ⇒ Object
52 53 54 |
# File 'lib/vx/gitlab_status_service/vexor_ci_service.rb', line 52 def title "Vexor CI" end |
#to_param ⇒ Object
60 61 62 |
# File 'lib/vx/gitlab_status_service/vexor_ci_service.rb', line 60 def to_param "vexor_ci" end |