git hook改为异步
This commit is contained in:
parent
dc29ccf3b7
commit
c45850eb8a
|
@ -94,14 +94,19 @@ class RepositoriesController < ApplicationController
|
||||||
|
|
||||||
|
|
||||||
HOOK_TEMPLATE = %Q{#!/bin/sh
|
HOOK_TEMPLATE = %Q{#!/bin/sh
|
||||||
exec git update-server-info
|
exec sh -c '
|
||||||
|
function update()
|
||||||
CMD_PATH=`dirname $0`
|
{
|
||||||
cd $CMD_PATH
|
CMD_PATH=`dirname $0`;
|
||||||
PY_PATH=$PWD/../../git_refresh_changes.py
|
cd $CMD_PATH;
|
||||||
[[ -s "$PY_PATH" ]] && $(which python) $PY_PATH $(dirname $PWD)
|
PY_PATH=$PWD/../../git_refresh_changes.py;
|
||||||
cd -
|
[[ -s "$PY_PATH" ]] && $(which python) $PY_PATH $PWD;
|
||||||
|
cd -;
|
||||||
}
|
}
|
||||||
|
git update-server-info
|
||||||
|
update
|
||||||
|
'
|
||||||
|
}
|
||||||
|
|
||||||
def create
|
def create
|
||||||
if params[:repository_scm].to_s == 'Gitlab'
|
if params[:repository_scm].to_s == 'Gitlab'
|
||||||
|
|
|
@ -1,14 +1,18 @@
|
||||||
namespace :git_post_update do
|
namespace :git_post_update do
|
||||||
|
|
||||||
HOOK_TEMPLATE = %Q{#!/bin/sh
|
HOOK_TEMPLATE = %Q{#!/bin/sh
|
||||||
|
exec sh -c '
|
||||||
exec git update-server-info
|
function update()
|
||||||
|
{
|
||||||
CMD_PATH=`dirname $0`
|
CMD_PATH=`dirname $0`;
|
||||||
cd $CMD_PATH
|
cd $CMD_PATH;
|
||||||
PY_PATH=$PWD/../../../git_refresh_changes.py
|
PY_PATH=$PWD/../../git_refresh_changes.py;
|
||||||
[[ -s "$PY_PATH" ]] && $(which python) $PY_PATH $(dirname $PWD)
|
[[ -s "$PY_PATH" ]] && $(which python) $PY_PATH $PWD;
|
||||||
cd -
|
cd -;
|
||||||
|
}
|
||||||
|
git update-server-info
|
||||||
|
update
|
||||||
|
'
|
||||||
}
|
}
|
||||||
|
|
||||||
desc "update old post-update file, REP_PATH"
|
desc "update old post-update file, REP_PATH"
|
||||||
|
|
Loading…
Reference in New Issue