public
nobgit
read
NobMail
Based on mailcow: dockerized
Languages
Repository composition by tracked source files.
PHP
49%
JavaScript
35%
HTML
9%
CSS
4%
Shell
2%
Python
1%
Lua
0%
Perl
0%
Ruby
0%
SCSS
0%
Create file
Wiki Documentation
Clone
https://nobgit.com/orgs/nobgit/nobmail.git
ssh://[email protected]:2222/orgs/nobgit/nobmail.git
Commit
Added Dev Mode option for git diff creation
61e23b6b
update.sh | 60 ++++++++++++++++++++++++++++++++----------------------------
1 file changed, 32 insertions(+), 28 deletions(-)
Diff
diff --git a/update.sh b/update.sh
index 1d0a3af6..f3bc9c2d 100755
--- a/update.sh
+++ b/update.sh
@@ -904,34 +904,38 @@ if [ "$CURRENT_REPO" != "$DEFAULT_REPO" ]; then
fi
fi
-echo -e "\e[32mCommitting current status...\e[0m"
-[[ -z "$(git config user.name)" ]] && git config user.name moo
-[[ -z "$(git config user.email)" ]] && git config user.email [email protected]
-[[ ! -z $(git ls-files data/conf/rspamd/override.d/worker-controller-password.inc) ]] && git rm data/conf/rspamd/override.d/worker-controller-password.inc
-git add -u
-git commit -am "Before update on ${DATE}" > /dev/null
-echo -e "\e[32mFetching updated code from remote...\e[0m"
-git fetch origin #${BRANCH}
-echo -e "\e[32mMerging local with remote code (recursive, strategy: \"${MERGE_STRATEGY:-theirs}\", options: \"patience\"...\e[0m"
-git config merge.defaultToUpstream true
-git merge -X${MERGE_STRATEGY:-theirs} -Xpatience -m "After update on ${DATE}"
-# Need to use a variable to not pass return codes of if checks
-MERGE_RETURN=$?
-if [[ ${MERGE_RETURN} == 128 ]]; then
- echo -e "\e[31m\nOh no, what happened?\n=> You most likely added files to your local mailcow instance that were now added to the official mailcow repository. Please move them to another location before updating mailcow.\e[0m"
- exit 1
-elif [[ ${MERGE_RETURN} == 1 ]]; then
- echo -e "\e[93mPotenial conflict, trying to fix...\e[0m"
- git status --porcelain | grep -E "UD|DU" | awk '{print $2}' | xargs rm -v
- git add -A
- git commit -m "After update on ${DATE}" > /dev/null
- git checkout .
- echo -e "\e[32mRemoved and recreated files if necessary.\e[0m"
-elif [[ ${MERGE_RETURN} != 0 ]]; then
- echo -e "\e[31m\nOh no, something went wrong. Please check the error message above.\e[0m"
- echo
- echo "Run $COMPOSE_COMMAND up -d to restart your stack without updates or try again after fixing the mentioned errors."
- exit 1
+if [ ! $DEV ]; then
+ echo -e "\e[32mCommitting current status...\e[0m"
+ [[ -z "$(git config user.name)" ]] && git config user.name moo
+ [[ -z "$(git config user.email)" ]] && git config user.email [email protected]
+ [[ ! -z $(git ls-files data/conf/rspamd/override.d/worker-controller-password.inc) ]] && git rm data/conf/rspamd/override.d/worker-controller-password.inc
+ git add -u
+ git commit -am "Before update on ${DATE}" > /dev/null
+ echo -e "\e[32mFetching updated code from remote...\e[0m"
+ git fetch origin #${BRANCH}
+ echo -e "\e[32mMerging local with remote code (recursive, strategy: \"${MERGE_STRATEGY:-theirs}\", options: \"patience\"...\e[0m"
+ git config merge.defaultToUpstream true
+ git merge -X${MERGE_STRATEGY:-theirs} -Xpatience -m "After update on ${DATE}"
+ # Need to use a variable to not pass return codes of if checks
+ MERGE_RETURN=$?
+ if [[ ${MERGE_RETURN} == 128 ]]; then
+ echo -e "\e[31m\nOh no, what happened?\n=> You most likely added files to your local mailcow instance that were now added to the official mailcow repository. Please move them to another location before updating mailcow.\e[0m"
+ exit 1
+ elif [[ ${MERGE_RETURN} == 1 ]]; then
+ echo -e "\e[93mPotenial conflict, trying to fix...\e[0m"
+ git status --porcelain | grep -E "UD|DU" | awk '{print $2}' | xargs rm -v
+ git add -A
+ git commit -m "After update on ${DATE}" > /dev/null
+ git checkout .
+ echo -e "\e[32mRemoved and recreated files if necessary.\e[0m"
+ elif [[ ${MERGE_RETURN} != 0 ]]; then
+ echo -e "\e[31m\nOh no, something went wrong. Please check the error message above.\e[0m"
+ echo
+ echo "Run $COMPOSE_COMMAND up -d to restart your stack without updates or try again after fixing the mentioned errors."
+ exit 1
+ fi
+elif [ $DEV ]; then
+ echo -e "\e[33mDEVELOPER MODE: Not creating a git diff and commiting it to prevent development stuff within a backup diff...\e[0m"
fi
echo -e "\e[32mFetching new images, if any...\e[0m"