mirror of
https://github.com/lukasbestle/projectr.git
synced 2026-10-11 23:10:19 +02:00
Update submodules after checking out revision
This commit is contained in:
+11
-2
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user