Merge branch 'master' of github.com:warpc/rosa-build
This commit is contained in:
commit
68ae986fde
|
@ -1,6 +1,6 @@
|
|||
#require 'lib/build_server.rb'
|
||||
class Platform < ActiveRecord::Base
|
||||
DOWNLOADS_PATH = RAILS_ROOT + '/public/downloads'
|
||||
DOWNLOADS_PATH = Rails.root + '/public/downloads'
|
||||
VISIBILITIES = ['open', 'hidden']
|
||||
|
||||
relationable :as => :target
|
||||
|
|
|
@ -17,7 +17,7 @@ class Project < ActiveRecord::Base
|
|||
has_many :auto_build_lists, :dependent => :destroy
|
||||
|
||||
validates :name, :uniqueness => {:scope => [:owner_id, :owner_type]}, :presence => true, :allow_nil => false, :allow_blank => false
|
||||
validates :unixname, :uniqueness => {:scope => [:owner_id, :owner_type]}, :presence => true, :format => { :with => /^[a-zA-Z0-9_]+$/ }, :allow_nil => false, :allow_blank => false
|
||||
validates :unixname, :uniqueness => {:scope => [:owner_id, :owner_type]}, :presence => true, :format => { :with => /^[a-zA-Z0-9_\-\+\.]+$/ }, :allow_nil => false, :allow_blank => false
|
||||
validates :owner, :presence => true
|
||||
validate {errors.add(:base, I18n.t('flash.project.save_warning_ssh_key')) if owner.ssh_key.blank?}
|
||||
|
||||
|
@ -36,6 +36,7 @@ class Project < ActiveRecord::Base
|
|||
after_create :create_git_repo
|
||||
before_update :update_git_repo
|
||||
after_destroy :destroy_git_repo
|
||||
after_rollback lambda { destroy_git_repo rescue true }
|
||||
|
||||
def project_versions
|
||||
#tags.collect { |tag| [tag.name, tag.name.gsub(/^\w+\./, "")] }.select { |pv| pv[0] =~ /^v\./ }
|
||||
|
|
|
@ -9,13 +9,9 @@ class ProjectToRepository < ActiveRecord::Base
|
|||
#after_destroy :remove_link
|
||||
#after_destroy :remove_compability_link
|
||||
|
||||
after_create lambda {
|
||||
project.xml_rpc_create(repository)
|
||||
}
|
||||
|
||||
after_destroy lambda {
|
||||
project.xml_rpc_destroy(repository)
|
||||
}
|
||||
after_create lambda { project.xml_rpc_create(repository) }
|
||||
after_destroy lambda { project.xml_rpc_destroy(repository) }
|
||||
after_rollback lambda { project.xml_rpc_destroy(repository) rescue true }
|
||||
|
||||
#def path
|
||||
# build_path(project.unixname)
|
||||
|
|
|
@ -27,9 +27,9 @@
|
|||
= link_to @repository.owner.name, url_for(@repository.owner)
|
||||
%p
|
||||
%b
|
||||
= t("activerecord.attributes.repository.visibility")
|
||||
= t("activerecord.attributes.platform.visibility")
|
||||
\:
|
||||
= @repository.visibility
|
||||
= @repository.platform.visibility
|
||||
%p
|
||||
%b
|
||||
= t("activerecord.attributes.repository.platform")
|
||||
|
|
|
@ -7,9 +7,9 @@
|
|||
%h2.title= t("layout.personal_repositories.settings_header")
|
||||
.inner
|
||||
.group
|
||||
%span= t("activerecord.attributes.repository.visibility") + ":"
|
||||
%span= t("activerecord.attributes.platform.visibility") + ":"
|
||||
%span
|
||||
%i= t("activerecord.attributes.repository.visibility_types.#{ @repository.platform.visibility }")
|
||||
%i= t("activerecord.attributes.platform.visibility_types.#{ @repository.platform.visibility }")
|
||||
.group
|
||||
= link_to t("layout.personal_repositories.change_visibility_from_#{ @repository.platform.visibility }"), change_visibility_personal_repository_path(@repository)
|
||||
|
||||
|
|
|
@ -19,7 +19,7 @@
|
|||
%ul.wat-cf
|
||||
%li.first.active= link_to t("layout.projects.list"), personal_repository_path(@repository) + "#projects"
|
||||
%li= link_to t("layout.projects.add"), add_project_personal_repository_path(@repository)
|
||||
%li= link_to t("layout.products.new"), new_platform_product_path(@repository.platform)
|
||||
%li= link_to t("layout.projects.new"), new_project_path(@repository.platform)
|
||||
.content
|
||||
%h2.title
|
||||
= t("layout.projects.list_header")
|
||||
|
|
|
@ -428,6 +428,10 @@ ru:
|
|||
created_at: Создана
|
||||
updated_at: Обновлена
|
||||
distrib_type: Тип дистрибутива
|
||||
visibility: Статус
|
||||
visibility_types:
|
||||
open: Открытый
|
||||
hidden: Закрытый
|
||||
|
||||
event_log:
|
||||
kind: Тип события
|
||||
|
|
|
@ -26,6 +26,7 @@
|
|||
personal_repositories:
|
||||
- index
|
||||
- show
|
||||
- settings
|
||||
- add_project
|
||||
- remove_project
|
||||
downloads:
|
||||
|
@ -224,6 +225,10 @@
|
|||
- index
|
||||
personal_repositories:
|
||||
- show
|
||||
- add_project
|
||||
- settings
|
||||
- change_visibility
|
||||
- remove_project
|
||||
auto_build_lists:
|
||||
- index
|
||||
repositories:
|
||||
|
|
|
@ -2,7 +2,8 @@ require 'gitolito'
|
|||
|
||||
class Object
|
||||
def with_ga(&block)
|
||||
::Gitolito::GitoliteAdmin.thread_safe(File.join(APP_CONFIG['root_path'], 'gitolite-admin'), {:wait_lock => true, :seconds => 30}) do |ga|
|
||||
Grit::Git.git_timeout = 60
|
||||
::Gitolito::GitoliteAdmin.thread_safe(File.join(APP_CONFIG['root_path'], 'gitolite-admin'), {:wait_lock => true, :seconds => 60}) do |ga|
|
||||
block.call(ga)
|
||||
end
|
||||
# ga = Gitolito::GitoliteAdmin.new File.join(APP_CONFIG['root_path'], 'gitolite-admin'); block.call(ga)
|
||||
|
|
|
@ -6,8 +6,10 @@ namespace :import do
|
|||
print "Import #{name}..."
|
||||
owner = User.find(2) # vsharshov@gmail.com
|
||||
# owner = Group.find(1) # Core Team
|
||||
puts Project.create(:name => name, :unixname => name) {|p| p.owner = owner} ? "Ok!" : "Fail!"
|
||||
sleep 1
|
||||
# puts Project.create(:name => name, :unixname => name) {|p| p.owner = owner} ? "Ok!" : "Fail"
|
||||
p = Project.find_or_create_by_name_and_unixname(name, name) {|p| p.owner = owner}
|
||||
puts p.persisted? ? "Ok!" : "Fail!"
|
||||
# sleep 1
|
||||
end
|
||||
puts 'DONE'
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue