Merge branch 'web_hooks' of https://github.com/ariejan/gitlabhq into ariejan-web_hooks

Conflicts:
	app/models/project.rb
	config/routes.rb
	db/schema.rb
This commit is contained in:
Valery Sizov 2011-12-27 23:21:26 +02:00
commit 66fb3909a5
18 changed files with 377 additions and 3 deletions

View file

@ -43,14 +43,14 @@ module Gitlabhq
def destroy_project(project)
FileUtils.rm_rf(project.path_to_repo)
ga_repo = ::Gitolite::GitoliteAdmin.new(File.join(@local_dir,'gitolite'))
conf = ga_repo.config
conf.rm_repo(project.path)
ga_repo.save
end
#update or create
#update or create
def update_keys(user, key)
File.open(File.join(@local_dir, 'gitolite/keydir',"#{user}.pub"), 'w') {|f| f.write(key.gsub(/\n/,'')) }
end

12
lib/post-receive-hook Executable file
View file

@ -0,0 +1,12 @@
#!/bin/bash
# This file was placed here by Gitlab. It makes sure that your pushed commits
# will be processed properly.
while read oldrev newrev ref
do
# For every branch or tag that was pushed, create a Resque job in redis.
pwd=`pwd`
reponame=`basename "$pwd" | cut -d. -f1`
env -i redis-cli rpush "resque:queue:post-receive" "{\"class\":\"PostReceive\",\"args\":[\"$reponame\",\"$oldrev\",\"$newrev\",\"$ref\"]}" > /dev/null 2>&1
done

1
lib/tasks/resque.rake Normal file
View file

@ -0,0 +1 @@
require 'resque/tasks'