Clean up script

This commit is contained in:
2020-03-13 10:04:40 -04:00
parent bbec36da82
commit 00c8f025bb

View File

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