From 0e6c2e1be576e8318d85ae71475943ee79810fb0 Mon Sep 17 00:00:00 2001 From: Mr Chen Date: Thu, 13 Dec 2018 20:01:29 +0800 Subject: [PATCH] update --- plugins/csvn/hook/commit.tpl | 16 ++++++++++++++++ plugins/csvn/hook/post-commit.tpl | 5 ++--- plugins/csvn/index.py | 1 + 3 files changed, 19 insertions(+), 3 deletions(-) create mode 100755 plugins/csvn/hook/commit.tpl diff --git a/plugins/csvn/hook/commit.tpl b/plugins/csvn/hook/commit.tpl new file mode 100755 index 000000000..94cc3b0ad --- /dev/null +++ b/plugins/csvn/hook/commit.tpl @@ -0,0 +1,16 @@ +#!/bin/bash + + +REPOS="$1" +REV="$2" +TXN_NAME="$3" + + +WEB_PATH={$PROJECT_DIR}/wwwroot/$REPOS_NAME +SVN_PATH=http://127.0.0.1:{$PORT}/svn/$REPOS + +if [ ! -d $WEB_PATH ]; then + svn co $SVN_PATH $WEB_PATH --username={$CSVN_USER} --password={$CSVN_PWD} +fi + +cd $WEB_PATH && svn update --username={$CSVN_USER} --password={$CSVN_PWD} \ No newline at end of file diff --git a/plugins/csvn/hook/post-commit.tpl b/plugins/csvn/hook/post-commit.tpl index 960fa5e1b..2e52d3f19 100755 --- a/plugins/csvn/hook/post-commit.tpl +++ b/plugins/csvn/hook/post-commit.tpl @@ -6,7 +6,6 @@ REPOS="$1" REV="$2" TXN_NAME="$3" - REPOS_NAME=${REPOS##*/} -WEB_DIR={$PRJOECT_DIR}/wwwroot/$REPOS_NAME -SVN_PATH=http://127.0.0.1:{$PORT}/svn/$REPOS_NAME + +sh -x $REPOS/hooks/commit $REPOS_NAME $REV $TXN_NAME 2>$REPOS/sh.log diff --git a/plugins/csvn/index.py b/plugins/csvn/index.py index ef6937bb2..216346760 100755 --- a/plugins/csvn/index.py +++ b/plugins/csvn/index.py @@ -528,6 +528,7 @@ def projectScriptLoad(): public.writeFile(pro_commit_file, content) public.execShell('chmod 777 ' + pro_commit_file) + return 'ok'