From 1c15133a522f435e954aa27a010b80cd222d81b5 Mon Sep 17 00:00:00 2001 From: Malte Jesgarzewsky Date: Fri, 2 Sep 2022 19:22:48 +0200 Subject: [PATCH 1/2] Modified branch switch in generate_config.sh Added possibility to define the mailcow branch by an environment variable to be able to bypass input. --- generate_config.sh | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/generate_config.sh b/generate_config.sh index afd1d892..ed68f0cd 100755 --- a/generate_config.sh +++ b/generate_config.sh @@ -141,7 +141,9 @@ echo "Available Branches:" echo "- master branch (stable updates) | default, recommended [1]" echo "- nightly branch (unstable updates, testing) | not-production ready [2]" sleep 1 -read -r -p "Choose the Branch with it´s number [1/2] " branch + +while [ -z "${MAILCOW_BRANCH}" ]; do + read -r -p "Choose the Branch with it´s number [1/2] " branch case $branch in [2]) git_branch="nightly" @@ -150,6 +152,11 @@ read -r -p "Choose the Branch with it´s number [1/2] " branch git_branch="master" ;; esac +done + +if [ ! -z "${MAILCOW_BRANCH}" ]; then + git_branch=${MAILCOW_BRANCH} +fi git fetch --all git checkout -f $git_branch @@ -458,4 +465,4 @@ else echo ' $MAILCOW_UPDATEDAT='$(date +%s)';' >> data/web/inc/app_info.inc.php echo '?>' >> data/web/inc/app_info.inc.php echo -e "\e[33mCannot determine current git repository version...\e[0m" -fi \ No newline at end of file +fi From b5f5b53e37dcc4babca8e5e383c1b11292391709 Mon Sep 17 00:00:00 2001 From: Malte Jesgarzewsky Date: Mon, 5 Sep 2022 09:41:19 +0200 Subject: [PATCH 2/2] Update generate_config.sh Fixed bug in loop by replacing the variable. --- generate_config.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/generate_config.sh b/generate_config.sh index ed68f0cd..70dc5887 100755 --- a/generate_config.sh +++ b/generate_config.sh @@ -146,10 +146,10 @@ while [ -z "${MAILCOW_BRANCH}" ]; do read -r -p "Choose the Branch with it´s number [1/2] " branch case $branch in [2]) - git_branch="nightly" + MAILCOW_BRANCH="nightly" ;; *) - git_branch="master" + MAILCOW_BRANCH="master" ;; esac done