Update submodules after checking out revision

master 2.0.2
Lukas Bestle 9 years ago
parent e0103f4f30
commit b54bb5013c

@ -110,7 +110,7 @@ echo -e "\033[1;35mRun on \033[34m$(date)\033[35m by \033[34m$USER\033[35m:\n---
else
# Yes, only fetch from the remote repository
echo -e "\033[1mFetching new commits from \033[34m$url\033[0;1m...\033[0m"
if ! (cd "$project/repo"; git fetch; git submodule update --init --recursive); then
if ! (cd "$project/repo"; git fetch); then
echo -e " => \033[31mCould not fetch from \033[34m$url\033[31m.\033[0m" >&2
exit 1
fi
@ -174,13 +174,22 @@ echo -e "\033[1;35mRun on \033[34m$(date)\033[35m by \033[34m$USER\033[35m:\n---
# Checkout correct revision
echo -e "\033[1mChecking out revision \033[34m$revision\033[0;1m...\033[0m"
if ! $(cd "$destination" && git checkout "$revision"); then
if ! $(cd "$destination"; git checkout "$revision"); then
echo -e " => \033[31mCould not checkout revision \033[34m$revision\033[31m of project \033[34m$project\033[31m.\033[0m" >&2
project_deploy::reverse "$project" "$destination"
exit 1
fi
echo -e " => \033[32mSuccess.\033[0m"
# Update submodules
echo -e "\033[1mUpdating submodules...\033[0m"
if ! $(cd "$destination"; git submodule update --init --recursive); then
echo -e " => \033[31mCould not update submodules of project \033[34m$project\033[31m.\033[0m" >&2
project_deploy::reverse "$project" "$destination"
exit 1
fi
echo -e " => \033[32mSuccess.\033[0m"
# Run post-deploy script if existing
if [[ -x "$destination/.postdeploy.sh" ]]; then
# Set the working directory to the destination

Loading…
Cancel
Save