Add function to ask if we want to install Master from Git. Update writing to config...
authorAndy Witter <awitter@georgialibraries.org>
Fri, 26 Jul 2019 20:51:32 +0000 (16:51 -0400)
committerAndy Witter <awitter@georgialibraries.org>
Fri, 26 Jul 2019 20:51:32 +0000 (16:51 -0400)
GenaSYS.sh

index b2ef1ee..7cae488 100755 (executable)
@@ -26,7 +26,7 @@
    SYNOPSIS_="$NAME_"
    REQUIRES_="standard GNU commands, apt, dpkg"
     VERSION_="1.99"
-       DATE_="2010-11-23; last update: 2019-04-09"
+       DATE_="2010-11-23; last update: 2019-07-11"
      AUTHOR_="Andy Witter <awitter@georgialibraries.org>"
         URL_="http://evergreen-ils.org"
    CATEGORY_="devel"
@@ -295,6 +295,7 @@ echo -e "Press ${COL_BR_CYAN}[Enter]${COL_RESET} to continue or ${COL_BR_CYAN}[C
 read -p "if you need to do any of the above." ENTER
 
 
+
 Check_Test_Cluster () { ### Ask if this is a test cluster
 echo;echo;echo;echo
 TitleBar "Testing or Production"
@@ -326,8 +327,27 @@ if [ "$TEST_CLUSTER" = "y" ] || [ "$TEST_CLUSTER" = "Y" ]
 fi
 }
 
-Choose_Detected_Domain_Name () { ### Prompt to use detected domain name.
+Check_Install_From_Git () { ### Ask if we want to install master from git instead of the debs.
+echo;echo;echo;echo 
+TitleBar "Inatallation Method"
+echo
+echo -e "Do you want to install Evergreen Version ${EG_VERSION} -OR-"
+echo -e "Install the cureent Evergreen Master from Git?"
 echo
+while true; do
+    read -n 1 -p "Install master from git? [y/n] : " INSTALL_MASTER_FROM_GIT
+    case $INSTALL_MASTER_FROM_GIT in
+        [Yy]* ) echo ; echo Installing Evergreen Master from git...; sleep 2 ; break;;
+        [Nn]* ) echo ; echo Installing Evergreen ${EG_VERSION} ; sleep 2 ; break;;
+        * ) echo " Please answer yes or no.";;
+    esac
+done
+echo
+
+}
+
+Choose_Detected_Domain_Name () { ### Prompt to use detected domain name.
+echo;echo;echo;echo
 #echo -e $COL_BR_BLUE"________Global Configuration________"$COL_RESET
 TitleBar "Global Configuration"
 echo
@@ -1131,6 +1151,11 @@ if [ -z $TEST_CLUSTER ] || [ "$USE_CONFIG_FILE" == "0" ] ; then
 Check_Test_Cluster
 fi
 
+### Check if we are installing Evergreen Master from git..
+if [ -z $INSTALL_MASTER_FROM_GIT ] || [ "$USE_CONFIG_FILE" == "0" ] ; then
+Check_Install_From_Git
+fi
+
 ### Prompt to use detected domain name.
 if [ -z $CLUSTERDOMAINNAME ] || [ "$USE_CONFIG_FILE" == "0" ] ; then
 Choose_Detected_Domain_Name
@@ -1168,6 +1193,7 @@ echo "## Created $(date)" >> $NEW_CONFIG_FILE
 echo >> $NEW_CONFIG_FILE
 
 Write_Config_File TEST_CLUSTER
+Write_Config_File INSTALL_MASTER_FROM_GIT
 Write_Config_File ROBOTS_TXT
 Write_Config_File CLUSTERDOMAINNAME 
 
@@ -3173,7 +3199,7 @@ do
                touch ../setup_${SUBFOLDER}/.osrf_node
                sed -i "s^HOSTNAME^${SUBFOLDER}^g" ../setup_${SUBFOLDER}/debconf-settings
                        
-               cp -R $TEMPLATEDIR/debs ../setup_${SUBFOLDER}
+               [ "${INSTALL_MASTER_FROM_GIT}" = "n" ] && cp -R $TEMPLATEDIR/debs ../setup_${SUBFOLDER}
                if [ -e "${SUBFOLDER}_drones.txt" ] 
                then 
                        mv ${SUBFOLDER}_drones.txt ../setup_${SUBFOLDER}
@@ -3259,7 +3285,10 @@ grep -qx ${NODE_FOLDER} "$TMPOSRFNODES" && \
 cp "$TMPFOLDER/debconf-settings" "setup_${NODE_FOLDER}" && \
 touch "setup_${NODE_FOLDER}/.osrf_node" && \
 sed -i "s^HOSTNAME^${NODE_FOLDER}^g" "setup_${NODE_FOLDER}/debconf-settings" && \
-cp -R "$TEMPLATEDIR/debs" "setup_${NODE_FOLDER}" 
+if [ "${INSTALL_MASTER_FROM_GIT}" = "n" ] 
+then
+     cp -R "$TEMPLATEDIR/debs" "setup_${NODE_FOLDER}" 
+fi
 if echo ${NODE_FOLDER} | grep -q db0
 then
        cp -f "$TMPOSRFNODES" "setup_${NODE_FOLDER}/opensrf_nodes.txt"