Compare commits
1 Commits
386766e3f6
...
2cd5c52013
| Author | SHA1 | Date | |
|---|---|---|---|
| 2cd5c52013 |
@@ -1,19 +1,17 @@
|
||||
#!/usr/bin/env bash
|
||||
# post-receive hook to build and deploy jekyll sites
|
||||
"/var/lib/git/gogs/gogs" hook --config='/var/lib/git/gogs/conf/app.ini' post-receive
|
||||
|
||||
GIT_REPO="$(pwd)"
|
||||
TMP_GIT_CLONE="/tmp/${GIT_REPO##*/}"
|
||||
GIT_DIR="$(pwd)"
|
||||
TMP_GIT_DIR="/tmp/${GIT_DIR##*/}"
|
||||
|
||||
if [ ! -d "${TMP_GIT_CLONE}" ]; then
|
||||
git clone "${GIT_REPO}" "${TMP_GIT_CLONE}"
|
||||
cd "${TMP_GIT_CLONE}"
|
||||
if [ ! -d "${TMP_GIT_DIR}" ]; then
|
||||
git clone "${GIT_DIR}" "${TMP_GIT_DIR}"
|
||||
cd "${TMP_GIT_DIR}"
|
||||
else
|
||||
cd "${TMP_GIT_CLONE}"
|
||||
|
||||
cd "${TMP_GIT_DIR}"
|
||||
unset GIT_DIR
|
||||
git fetch --all
|
||||
git reset --hard origin/master
|
||||
|
||||
git pull
|
||||
fi
|
||||
|
||||
@@ -25,4 +23,5 @@ for site in *.*/; do
|
||||
popd
|
||||
done
|
||||
|
||||
exit 0
|
||||
|
||||
exit
|
||||
|
||||
Reference in New Issue
Block a user