diff --git a/app/models/build_list.rb b/app/models/build_list.rb index 132050a34..73f55ceef 100644 --- a/app/models/build_list.rb +++ b/app/models/build_list.rb @@ -431,7 +431,7 @@ class BuildList < ActiveRecord::Base urpmi_list(nil, nil, false, save_to_repository.name)["#{build_for_platform.name}"]["#{arch.name}"] end - git_project_address = project.git_project_address(user) + git_project_address = project.git_url user # git_project_address.gsub!(/^http:\/\/(0\.0\.0\.0|localhost)\:[\d]+/, 'https://abf.rosalinux.ru') unless Rails.env.production? { :id => id, diff --git a/app/models/project.rb b/app/models/project.rb index 2990eb472..daecf38a2 100644 --- a/app/models/project.rb +++ b/app/models/project.rb @@ -138,15 +138,20 @@ class Project < ActiveRecord::Base owner == user end - def git_project_address(auth_user = nil) + def html_url(auth_user = nil) host ||= EventLog.current_controller.request.host_with_port rescue ::Rosa::Application.config.action_mailer.default_url_options[:host] protocol = APP_CONFIG['mailer_https_url'] ? "https" : "http" rescue "http" opts = {:host => host, :protocol => protocol} opts.merge!({:user => auth_user.authentication_token, :password => ''}) if auth_user && !self.public? - Rails.application.routes.url_helpers.project_url(self.owner.uname, self.name, opts) + ".git" + Rails.application.routes.url_helpers.project_url(self.owner.uname, self.name, opts) #path #share by NFS end + def git_url(auth_user) + html_url(auth_user) + '.git' + end + + def build_for(platform, repository_id, user, arch = Arch.find_by_name('i586'), auto_publish = false, mass_build_id = nil, priority = 0) # Select main and project platform repository(contrib, non-free and etc) # If main does not exist, will connect only project platform repository @@ -242,10 +247,6 @@ class Project < ActiveRecord::Base @archive ||= create_archive treeish, format end - def html_url - git_project_address.gsub(/.git$/, '') - end - protected def create_archive(treeish, format)