X-Git-Url: https://feistymeow.org/gitweb/?a=blobdiff_plain;f=scripts%2Fsite_avenger%2Fshared_site_mgr.sh;h=b30ca82dbb600bafdabd11d5be5fecd8810c89f2;hb=fdcfc633582d7491e7af348ae3b023c5ee83de0b;hp=8b18814cd3031926177e7b298be26c80adf417fe;hpb=170a8e062d9283e65716e7aa55930ade13a66f7a;p=feisty_meow.git diff --git a/scripts/site_avenger/shared_site_mgr.sh b/scripts/site_avenger/shared_site_mgr.sh index 8b18814c..b30ca82d 100644 --- a/scripts/site_avenger/shared_site_mgr.sh +++ b/scripts/site_avenger/shared_site_mgr.sh @@ -5,8 +5,23 @@ # This contains a bunch of reusable functions that help out in managing websites. +# This script is sourced, and relies on the value of WORKDIR, which should +# point at the directory where the site management scripts are stored, +# especially this one. + source "$FEISTY_MEOW_SCRIPTS/core/launch_feisty_meow.sh" +# get our configuration loaded, if we know the config file. +# if there is none, we will use our default version. +export SITE_MANAGEMENT_CONFIG_FILE +if [ -z "$SITE_MANAGEMENT_CONFIG_FILE" ]; then + SITE_MANAGEMENT_CONFIG_FILE="$WORKDIR/config/default.app" +fi + +# load in at least the default version to get us moving. +source "$SITE_MANAGEMENT_CONFIG_FILE" +test_or_die "loading site management configuration from: $SITE_MANAGEMENT_CONFIG_FILE" + # configure feisty revision control to ignore vendor folders. export NO_CHECKIN_VENDOR=true @@ -71,6 +86,25 @@ function find_app_folder() test_or_die "Testing application folder: $app_dirname" echo "Application folder is: $app_dirname" + + local configfile="$WORKDIR/config/${app_dirname}.app" + if [ ! -f "$configfile" ]; then + # this is not a good config file. we can't auto-guess the config. + echo -e " +There is no specific site configuration file in: + $configfile +We will continue onward using the default and hope that this project follows +the standard pattern for cakephp projects." + # we'll pull in the default config file we set earlier; this will + # reinitialize some variables based on the app name. + else + # they gave us a valid config file. let's try using it. + SITE_MANAGEMENT_CONFIG_FILE="$configfile" + fi + + # try to load the config. + source "$SITE_MANAGEMENT_CONFIG_FILE" + test_or_die "loading site management configuration from: $SITE_MANAGEMENT_CONFIG_FILE" } # ensures that the app directory name is valid.