Merge branch 'master' of github.com:warpc/rosa-build

This commit is contained in:
Vladimir Sharshov 2011-10-28 20:24:44 +04:00
commit cd0e6a9415
9 changed files with 44 additions and 19 deletions

View File

@ -1,6 +1,7 @@
class PersonalRepositoriesController < ApplicationController
before_filter :authenticate_user!
before_filter :find_repository#, :only => [:show, :destroy, :add_project, :remove_project, :make_private, :settings]
before_filter :check_repository
def show
if params[:query]
@ -64,4 +65,8 @@ class PersonalRepositoriesController < ApplicationController
def find_repository
@repository = Repository.find(params[:id])
end
def check_repository
redirect_to root_path if !@repository.platform.personal?
end
end

View File

@ -45,6 +45,10 @@ class Platform < ActiveRecord::Base
self.visibility == 'hidden'
end
def personal?
platform_type == 'personal'
end
def clone(new_name, new_unixname)
p = Platform.new
p.name = new_name

View File

@ -37,7 +37,7 @@
-if current_user.can_perform?('roles', 'index')
%li{:class => controller.controller_path == 'roles' ? 'active' : '' }
%a{:href => roles_path}= t("layout.menu.roles")
-if current_user.can_perform?('personal_repositories', 'index')
-if current_user.can_perform?('personal_repositories', 'show')
%li{:class => controller.controller_path == 'personal_repositories' ? 'active' : '' }
%a{:href => personal_repository_path( current_user.personal_repository.id )}= t("layout.menu.personal_repository")
#wrapper.wat-cf

View File

@ -19,6 +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)
.content
%h2.title
= t("layout.projects.list_header")

View File

@ -27,9 +27,9 @@ Rosa::Application.configure do
end
# Uncomment this to stub XML RPC calls
# require 'xmlrpc/client'
# module XMLRPC
# class Client
# def call(*args); 0; end
# end
# end
require 'xmlrpc/client'
module XMLRPC
class Client
def call(*args); 0; end
end
end

View File

@ -23,6 +23,11 @@
- remove_project
- destroy
- new
personal_repositories:
- index
- show
- add_project
- remove_project
downloads:
- index
platforms:
@ -217,6 +222,8 @@
- index
groups:
- index
personal_repositories:
- show
repositories:
- index
platforms:

View File

@ -261,11 +261,10 @@ ActiveRecord::Schema.define(:version => 20111028070604) do
create_table "users", :force => true do |t|
t.string "name"
t.string "email", :default => "", :null => false
t.string "encrypted_password", :limit => 128, :default => "", :null => false
t.string "password_salt", :default => "", :null => false
t.string "email", :default => "", :null => false
t.string "encrypted_password", :limit => 128, :default => "", :null => false
t.string "reset_password_token"
t.string "remember_token"
t.datetime "reset_password_sent_at"
t.datetime "remember_created_at"
t.datetime "created_at"
t.datetime "updated_at"

View File

@ -6,6 +6,8 @@
* urpmi git
* useradd git
* passwd git
* mkdir /share/git_projects
* sudo chown git:git /share/git_projects
--------------- As user who will manage gitolite
@ -18,16 +20,16 @@
* src/gl-system-install
* gl-setup /tmp/ga_admin.pub
--------------- Settings for .gitolite.rc during install
* $REPO_UMASK = 0022;
* $REPO_BASE = "/home/share/git_projects";
* $GIT_PATH = "/opt/local/bin"; # if you have several git versions
--------------- As user who will manage gitolite
* cd /share # /var/rosa
* git clone git@gitolite:gitolite-admin
* ln -s /home/git/repositories git_projects
* sudo chmod -R +r /home/git/repositories
--------------- Settings for .gitolite.rc
* $REPO_UMASK = 0022;
* git clone git@localhost:gitolite-admin
--------------- Setup hooks
@ -36,3 +38,10 @@
* mkdir update.secondary.d
* touch update.secondary.d/update.auto-build
* chmod +x update.secondary update.secondary.d/update.auto-build
--------------- Code for update.auto-build
#!/bin/sh
if [ "$GL_REPO" != "gitolite-admin" ]; then
curl "http://localhost:3000/projects/auto_build?git_repo=$GL_REPO&git_user=$GL_USER"
fi

View File

@ -2,7 +2,7 @@ require 'gitolito'
class Object
def with_ga(&block)
::Gitolito::GitoliteAdmin.thread_safe(File.join(APP_CONFIG['root_path'], 'gitolite-admin'), {:wait_lock => true, :seconds => 15}) do |ga|
::Gitolito::GitoliteAdmin.thread_safe(File.join(APP_CONFIG['root_path'], 'gitolite-admin'), {:wait_lock => true, :seconds => 30}) do |ga|
block.call(ga)
end
# ga = Gitolito::GitoliteAdmin.new File.join(APP_CONFIG['root_path'], 'gitolite-admin'); block.call(ga)