diff options
author | Aaron LI <aly@aaronly.me> | 2019-09-22 15:32:18 +0800 |
---|---|---|
committer | Aaron LI <aly@aaronly.me> | 2019-09-22 15:32:18 +0800 |
commit | dd30bd4252b0f199d2c55df861ea95a1acaf0403 (patch) | |
tree | c54e816727d84aee3d09d9812e625f855c643c10 /roles/git/templates/cgit | |
parent | 1d2d14db6f719d50a95651c99ec19b69279c0ef5 (diff) | |
download | ansible-dfly-vps-dd30bd4252b0f199d2c55df861ea95a1acaf0403.tar.bz2 |
git: Rework the post-preceive hook for cgit-static repo
Diffstat (limited to 'roles/git/templates/cgit')
-rw-r--r-- | roles/git/templates/cgit/post-receive.j2 | 31 |
1 files changed, 0 insertions, 31 deletions
diff --git a/roles/git/templates/cgit/post-receive.j2 b/roles/git/templates/cgit/post-receive.j2 deleted file mode 100644 index 14b455a..0000000 --- a/roles/git/templates/cgit/post-receive.j2 +++ /dev/null @@ -1,31 +0,0 @@ -#!/bin/sh -# -# post-receive hook for the cgit-static.git repo to checkout the -# resources upon push, a.k.a., deploy on push. -# -# Aaron LI -# 2018-04-18 -# - -GIT_DIR="{{ git.user.home }}/{{ git.cgit.static_repo }}/" -TARGET="{{ git.cgit.root }}/static/" -TARGET_BRANCH="master" - -while read oldrev newrev refname; do - branch=$(git rev-parse --symbolic --abbrev-ref ${refname}) - if [ -n "${branch}" ] && [ "${branch}" = "${TARGET_BRANCH}" ]; then - echo "Deploying cgit static resources ..." - git --work-tree=${TARGET} --git-dir=${GIT_DIR} \ - checkout ${TARGET_BRANCH} -f - - NOW=$(date +"%Y%m%d-%H%M") - git tag release_${NOW} ${TARGET_BRANCH} - - echo " +===============================" - echo " | DEPLOYMENT COMPLETED" - echo " | Target branch: ${TARGET_BRANCH}" - echo " | Target folder: ${TARGET}" - echo " | Tag name : release_${NOW}" - echo " +===============================" - fi -done |