Class: Api::Clients::Sonarqube

Inherits:
Object
  • Object
show all
Defined in:
lib/api/clients/sonarqube.rb

Constant Summary collapse

SQ_API =
"https://sonarqube.sportradar.ag/api"
TOKEN =
ENV["SQ_TOKEN"]
USER =
ENV["SQ_USER"]

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(project:, gitlab_url:) ⇒ Sonarqube

Public:

  • project: project key

  • gitlab_url: gitlab project url



20
21
22
23
# File 'lib/api/clients/sonarqube.rb', line 20

def initialize(project:, gitlab_url:)
  @gitlab_url = gitlab_url
  @project = project
end

Instance Attribute Details

#gitlab_urlObject

Returns the value of attribute gitlab_url.



11
12
13
# File 'lib/api/clients/sonarqube.rb', line 11

def gitlab_url
  @gitlab_url
end

#projectObject

Returns the value of attribute project.



11
12
13
# File 'lib/api/clients/sonarqube.rb', line 11

def project
  @project
end

Instance Method Details

Public: create link of project with gitlab’s url



26
27
28
29
# File 'lib/api/clients/sonarqube.rb', line 26

def link_project!
  return if project_has_link?
  post_call save_link_url
end

Public: get project links



32
33
34
# File 'lib/api/clients/sonarqube.rb', line 32

def project_links
  get_call(get_links_url)["links"]
end