Clean up script
This commit is contained in:
@@ -38,9 +38,9 @@ TMP_GIT_DIR="/tmp/${GIT_DIR##*/}"
|
|||||||
|
|
||||||
if [[ ! -d "${TMP_GIT_DIR}" ]]; then
|
if [[ ! -d "${TMP_GIT_DIR}" ]]; then
|
||||||
git clone "${GIT_DIR}" "${TMP_GIT_DIR}"
|
git clone "${GIT_DIR}" "${TMP_GIT_DIR}"
|
||||||
cd "${TMP_GIT_DIR}"
|
cd "${TMP_GIT_DIR}" || exit $?
|
||||||
else
|
else
|
||||||
cd "${TMP_GIT_DIR}"
|
cd "${TMP_GIT_DIR}" || exit $?
|
||||||
unset GIT_DIR
|
unset GIT_DIR
|
||||||
git fetch --all
|
git fetch --all
|
||||||
git reset --hard origin/master
|
git reset --hard origin/master
|
||||||
@@ -48,12 +48,18 @@ else
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
for site in *.*/; do
|
for site in *.*/; do
|
||||||
[[ ! -d "/var/www/${site}" ]] && mkdir -p "/var/www/${site}" && chgrp -R "/var/www/${site}" && chmod g+s "/var/www/${site}"
|
deploy_dir="/var/www/${site}"
|
||||||
pushd "${site}"
|
if [[ ! -d "$deploy_dir" ]]; then
|
||||||
bundle install --deployment
|
mkdir -p "$deploy_dir"
|
||||||
bundle exec jekyll build --destination "/var/www/${site}"
|
chgrp -R "$deploy_dir"
|
||||||
popd
|
chmod g+s "$deploy_dir"
|
||||||
|
fi
|
||||||
|
pushd "${site}" || exit $?
|
||||||
|
bundle install --deployment
|
||||||
|
bundle exec jekyll build --destination "$deploy_dir"
|
||||||
|
popd || exit $?
|
||||||
done
|
done
|
||||||
|
|
||||||
exit
|
exit 0
|
||||||
|
|
||||||
~~~
|
~~~
|
||||||
|
|||||||
Reference in New Issue
Block a user