diff options
author | Parabola git <git@parabola.nu> | 2020-03-12 20:00:02 +0000 |
---|---|---|
committer | Parabola git <git@parabola.nu> | 2020-03-12 20:00:02 +0000 |
commit | b82b102c084e132906f828100312b93856543d0f (patch) | |
tree | 6aa1e74d8c33daa2f9b0de459429278162966dfc | |
parent | 2fe770b7f73948d916b0d77740f69b5d96fed765 (diff) |
Update from cron
-rwxr-xr-x | abslibre/blacklist.git/hooks/pre-receive | 26 |
1 files changed, 19 insertions, 7 deletions
diff --git a/abslibre/blacklist.git/hooks/pre-receive b/abslibre/blacklist.git/hooks/pre-receive index 5a9fdef..3a0376d 100755 --- a/abslibre/blacklist.git/hooks/pre-receive +++ b/abslibre/blacklist.git/hooks/pre-receive @@ -9,7 +9,7 @@ ## constants ## readonly LOG_BLACKLIST_GIT_HOOK=1 -readonly CLONE_DIR=/home/autobuilder/blacklist +readonly CLONE_DIR=/home/autobuilder/packages/blacklist-validate-git-hook readonly LOG_DIR=/var/log/blacklist-validate-git-hook readonly SHA_REGEX='^([0-9a-f]{40})$' @@ -37,7 +37,7 @@ LogParseRefData() # (ref_data prev_sha curr_sha ref_file repo ref is_deletion) echo "ref=${ref}" >> ${log_file} && \ echo "is_deletion=${is_deletion}" >> ${log_file} -cat $log_file +#cat $log_file } @@ -62,19 +62,31 @@ LogParseRefData "${ref_data}" ${prev_sha} ${curr_sha} ${ref_file} ${repo} ${ref} (( ! ${is_deletion} )) || return 0 - [[ -f ${CLONE_DIR}/blacklist.txt ]] || return 1 - + [[ -f ${CLONE_DIR}/blacklist.txt ]] && \ + [[ -f ${CLONE_DIR}/check.sh ]] || return 1 + cd ${CLONE_DIR} # local tmp_dir=$(mktemp --directory --tmpdir=/tmp blacklist-validate-git-hook-XXXXXXXXXX) #pwd # git clone --no-hardlinks $(pwd) ${tmp_dir} # cd ${tmp_dir} -#GIT_WORK_TREE=/srv/git/abslibre/blacklist.git git fetch local-git-home + + ( + GIT_WORK_TREE=${CLONE_DIR}/ GIT_DIR=${CLONE_DIR}/.git +git log -1 --oneline +git log -1 --oneline $prev_sha +git log -1 --oneline $curr_sha +#GIT_WORK_TREE=${CLONE_DIR}/ GIT_DIR=${CLONE_DIR}/.git git fetch local-git-home + + git fetch local-git-home + git checkout ${curr_sha} . + ) -# git checkout -b validate ${curr_sha} +echo "prev_sha=$prev_sha curr_sha=$curr_sha" +#ls #git branch -pwd ; ls -al +#pwd ; ls -al # rm -rf ${tmp_dir} echo "ok tmp_dir=$tmp_dir" } |