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

This commit is contained in:
George Vinogradov 2011-10-28 21:56:17 +04:00
commit e880aee6cb
6 changed files with 32 additions and 24 deletions

View File

@ -29,10 +29,10 @@ class Project < ActiveRecord::Base
scope :addable_to_repository, lambda { |repository_id| where("projects.id NOT IN (SELECT project_to_repositories.project_id FROM project_to_repositories WHERE (project_to_repositories.repository_id != #{ repository_id }))") }
before_create :make_owner_rel
before_create :create_git_repo
before_update :update_git_repo
before_destroy :destroy_git_repo
after_create :attach_to_personal_repository
after_create :create_git_repo
before_update :update_git_repo
after_destroy :destroy_git_repo
def project_versions
self.git_repository.tags
@ -84,7 +84,7 @@ class Project < ActiveRecord::Base
if result == BuildServer::SUCCESS
return true
else
raise "Failed to create project #{name} (repo main) inside platform #{owner.uname}_personal with code #{result}."
raise "Failed to create project #{unixname} (repo #{repository.unixname}) inside platform #{repository.platform.unixname} in path #{path} with code #{result}."
end
end

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

@ -29,7 +29,7 @@ Rosa::Application.configure do
# Disable Rails's static asset server
# In production, Apache or nginx will already do this
config.serve_static_assets = true
config.serve_static_assets = false
# Enable serving of images, stylesheets, and javascripts from an asset server
# config.action_controller.asset_host = "http://assets.example.com"

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
@ -16,18 +18,18 @@
* git clone git://github.com/sitaramc/gitolite
* cd gitolite
* src/gl-system-install
* gl-setup /tmp/ga_admin.pub
* gl-setup ~/ga_admin.pub # /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)