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:
commit
66fb3909a5
18 changed files with 377 additions and 3 deletions
|
@ -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
12
lib/post-receive-hook
Executable 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
1
lib/tasks/resque.rake
Normal file
|
@ -0,0 +1 @@
|
|||
require 'resque/tasks'
|
Loading…
Add table
Add a link
Reference in a new issue