Commit 43924df5211fe8439a70978d10807c66eaee47d9

Authored by Leandro Santos
2 parents 3275c783 cab02175

fixing conflit

plugins/serpro_integration/lib/ext/profile.rb
... ... @@ -1,9 +0,0 @@
1   -require_dependency 'profile'
2   -
3   -class Profile
4   - settings_items :allow_sonar_integration, :type => :boolean, :default => false
5   - settings_items :allow_gitlab_integration, :type => :boolean, :default => false
6   -
7   - #FIXME make test for default option
8   - settings_items :serpro_integration_plugin, :type => Hash, :default => {}
9   -end
plugins/serpro_integration/lib/serpro_integration_plugin/jenkins_integration.rb
... ... @@ -3,13 +3,11 @@ require 'jenkins_api_client'
3 3  
4 4 class SerproIntegrationPlugin::JenkinsIntegration
5 5  
6   - attr_accessor :host, :project_name, :user, :private_token, :profile
  6 + attr_accessor :profile
7 7  
8 8 def initialize(host, private_token, user)
9 9 @client = JenkinsApi::Client.new(:server_url => host, :password => private_token, :username => user)
10 10 @profile = nil
11   - @host = host
12   - @user = user
13 11 @private_token = private_token
14 12 end
15 13  
... ... @@ -17,11 +15,17 @@ class SerproIntegrationPlugin::JenkinsIntegration
17 15 "#{host}/#{project_name}"
18 16 end
19 17  
  18 + def host
  19 + @profile.jenkins_host
  20 + end
  21 +
  22 + def project_name
  23 + @profile.jenkins_project_name
  24 + end
20 25 #FIXME make jenkins integration works
21 26 def create_jenkis_project(profile, repository_path, web_url, git_url)
22 27 @profile = profile
23 28 #begin
24   - @project_name = repository_path.split('/').last
25 29 if @client.job.list(project_name).blank?
26 30 @client.job.create(profile.jenkins_project_name, xml_jenkins(repository_path, web_url, git_url))
27 31 end
... ...