浏览代码

Added branch switch in generate_config.sh

DerLinkman 3 年之前
父节点
当前提交
4f380debb5
共有 1 个文件被更改,包括 20 次插入1 次删除
  1. 20 1
      generate_config.sh

+ 20 - 1
generate_config.sh

@@ -135,6 +135,25 @@ else
   SKIP_SOLR=n
   SKIP_SOLR=n
 fi
 fi
 
 
+echo "Which branch of mailcow do you want to use?"
+echo ""
+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
+  case $branch in
+    [2])
+      git_branch="nightly"
+      ;;
+    *)
+      git_branch="master"
+    ;;
+  esac
+
+git fetch --all
+git checkout -f $git_branch
+
 [ ! -f ./data/conf/rspamd/override.d/worker-controller-password.inc ] && echo '# Placeholder' > ./data/conf/rspamd/override.d/worker-controller-password.inc
 [ ! -f ./data/conf/rspamd/override.d/worker-controller-password.inc ] && echo '# Placeholder' > ./data/conf/rspamd/override.d/worker-controller-password.inc
 
 
 cat << EOF > mailcow.conf
 cat << EOF > mailcow.conf
@@ -413,4 +432,4 @@ else
   echo '  $MAILCOW_GIT_URL="";' >> data/web/inc/app_info.inc.php
   echo '  $MAILCOW_GIT_URL="";' >> data/web/inc/app_info.inc.php
   echo '?>' >> 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"
   echo -e "\e[33mCannot determine current git repository version...\e[0m"
-fi
+fi