Merge branch 'dev' of feistymeow.org:feisty_meow into dev
authorChris Koeritz <fred@gruntose.com>
Mon, 13 Nov 2017 02:57:11 +0000 (21:57 -0500)
committerChris Koeritz <fred@gruntose.com>
Mon, 13 Nov 2017 02:57:11 +0000 (21:57 -0500)
scripts/core/common.alias
scripts/site_avenger/config/default.app
scripts/site_avenger/config/mapsdemo.app
scripts/site_avenger/powerup.sh
scripts/site_avenger/shared_site_mgr.sh
scripts/site_avenger/standup.sh
scripts/system/add_apache_site.sh
scripts/system/add_domain.sh

index fae1b6c6e09032d4256e9c0b6cbf01cf7c1b7baa..cfb860d6461977393966611fc7875f57a2811da2 100644 (file)
@@ -102,7 +102,7 @@ define_yeti_alias feisty_branch='pushd $FEISTY_MEOW_APEX ; git branch ; popd'
 # some important retreads on aliases that provide a sudo-ized version of other scripts.
 
 define_yeti_alias snarf_linux_config="sudo -E PERLLIB=\$PERLLIB perl \$FEISTY_MEOW_SCRIPTS/archival/snarf_linux_config.pl"
-define_yeti_alias standup="sudo bash \"$FEISTY_MEOW_SCRIPTS/site_avenger/standup.sh\""
+#no, does its own sudo wrangling.edefine_yeti_alias standup="sudo bash \"$FEISTY_MEOW_SCRIPTS/site_avenger/standup.sh\""
 
 #hmmm: some magma intrusions from the fred customizations...
 define_yeti_alias revamp_web_permissions="sudo bash \"$FEISTY_MEOW_SCRIPTS/customize/fred/scripts/cakelampvm/revamp_web_permissions.sh\""
index 65e782d7b02664a3a08cf7cbf340d564b0a680e7..4fe8303cf9684d91ea468a5faefa431452908eaf 100644 (file)
@@ -6,9 +6,9 @@
 
 # basic information that is constant for all site avenger sites.
 
-APPLICATION_DIR="$HOME/apps"
-DEFAULT_REPOSITORY_ROOT="git@github.com:kwentworth"
-CHECKOUT_DIR_NAME="avenger5"
+export APPLICATION_DIR="$HOME/apps"
+export DEFAULT_REPOSITORY_ROOT="git@github.com:kwentworth"
+export CHECKOUT_DIR_NAME="avenger5"
 
 ####
 
@@ -23,20 +23,20 @@ CHECKOUT_DIR_NAME="avenger5"
 
 # deployment information for the application / site.
 
-APPLICATION_NAME="${app_dirname}"
+export APPLICATION_NAME="${app_dirname}"
 
 echo app name was computed as $APPLICATION_NAME
 
 # change this if the site is on the "real" internet.
-DOMAIN_NAME="${app_dirname}.vm"
+export DOMAIN_NAME="${app_dirname}.vm"
 
 echo domain name was computed as $DOMAIN_NAME
 
-REPO_NAME="${app_dirname}.git"
+export REPO_NAME="${app_dirname}"
 
 echo repo name was computed as $REPO_NAME
 
-THEME_NAME="$(capitalize_first_char "${app_dirname}.git")"
+export THEME_NAME="$(capitalize_first_char "${app_dirname}")"
 
 echo theme name was computed as $THEME_NAME
 
index a2bca519b1b348ffff577eff32c0d298f2532252..ab89231bc78044f60680371a6211e6bad268534a 100644 (file)
@@ -5,6 +5,6 @@
 
 source "$WORKDIR/config/default.app"
 
-DOMAIN_NAME="${APPLICATION_NAME}.cakelampvm.com"
+export DOMAIN_NAME="${APPLICATION_NAME}.cakelampvm.com"
 
 
index 998fcad57b4aae9517737ab6ea75bacb654b186e..c67bd25a689cf5f7613727c6bdc076165049ac3d 100644 (file)
 # start with.  The concept of the theme comes from cakephp.
 
 export WORKDIR="$( \cd "$(\dirname "$0")" && \pwd )"  # obtain the script's working directory.
+export FEISTY_MEOW_APEX="$( \cd "$WORKDIR/../.." && \pwd )"
+
+source "$FEISTY_MEOW_APEX/scripts/core/launch_feisty_meow.sh"
 
 ############################
 
 function print_instructions()
 {
   echo
-  echo "$(basename $0 .sh) [app dirname] [repository] [theme name]"
+  echo "$(basename $0 .sh) [app dirname] [repository] [theme name] "
+#[user name]
   echo
   echo "All parameters are optional, and intelligent guesses for them will be made."
   echo
   echo "app dirname: The folder where the app will be stored."
   echo "repository: The name of the git repository (short version, no URL)."
   echo "theme name: The name to use for the cakephp theme."
+#  echo "user name: The name of the user to chown the checkout to."
   echo
   exit 0
 }
@@ -46,6 +51,9 @@ function print_instructions()
 app_dirname="$1"; shift
 repo_name="$1"; shift
 theme_name="$1"; shift
+#user_name="$1"; shift
+
+#echo "*** user name is $user_name"
 
 if [ "$app_dirname" == "-help" -o "$app_dirname" == "--help" ]; then
   print_instructions
@@ -80,6 +88,9 @@ echo "Repository: $repo_name"
 echo "Theme name: $theme_name"
 sep
 
+echo in powerup before update repo with:
+var CHECKOUT_DIR_NAME DEFAULT_REPOSITORY_ROOT
+
 # this should set the site_store_path variable if everything goes well.
 update_repo "$full_app_dir" "$CHECKOUT_DIR_NAME" "$DEFAULT_REPOSITORY_ROOT" "$repo_name"
 test_or_die "Updating the repository storage directory"
@@ -96,5 +107,15 @@ create_site_links "$site_store_path" "$theme_name"
 
 sep
 
+#if [ ! -z "$user_name" ]; then
+#  echo "Chowning the apps folder to be owned by: $user_name"
+##hmmm: have to hope for now for standard group named after user 
+#  chown -R "$user_name:$user_name" "$APPLICATION_DIR"
+#  test_or_die "Chowning $APPLICATION_DIR to be owned by $user_name"
+#fi
+
+sep
+
+
 echo "Finished powering up the site in '${app_dirname}'."
 
index b30ca82dbb600bafdabd11d5be5fecd8810c89f2..3c03ccbe6002aeb52223f952b8150b83f1bc471d 100644 (file)
@@ -167,6 +167,9 @@ function update_repo()
   local repo_root="$1"; shift
   local repo_name="$1"; shift
 
+echo here are parms in update repo:
+var full_app_dir checkout_dirname repo_root repo_name
+
   # forget any prior value, since we are going to validate the path.
   unset site_store_path
 
@@ -175,10 +178,12 @@ function update_repo()
 
   local complete_path="$full_app_dir/$checkout_dirname"
 
+echo A
   # see if the checkout directory exits.  the repo_found variable is set to
   # non-empty if we find it and it's a valid git repo.
   repo_found=
   if [ -d "$checkout_dirname" ]; then
+echo B
     # checkout directory exists, so let's check it.
     pushd "$checkout_dirname" &>/dev/null
     test_or_die "Switching to our checkout directory: $checkout_dirname"
@@ -189,6 +194,7 @@ function update_repo()
       repo_found=yes
     fi
  
+echo C
     # we don't consider the state of having the dir exist but the repo be wrong as good.
     if [ -z "$repo_found" ]; then
       echo "There is a problem; this folder is not a valid repository:"
@@ -199,18 +205,22 @@ function update_repo()
     popd &>/dev/null
   fi
 
+echo D
   if [ ! -z "$repo_found" ]; then
     # a repository was found, so update the version here and leave.
+echo E
     echo "Repository $repo_name exists.  Updating it."
     rgetem
     test_or_die "Recursive checkout on: $complete_path"
   else
+echo F
     # clone the repo since it wasn't found.
     echo "Cloning repository $repo_name now."
     git clone "$repo_root/$repo_name.git" $checkout_dirname
     test_or_die "Git clone of repository: $repo_name"
   fi
 
+echo G
   fix_site_perms "$complete_path"
 
   # construct the full path to where the app will actually live.
index 56684b9cefd8d3bbdc06bb433f6345cb05be7d71..96ec4cf3943434aad02388533f8d8a7b1a8dee9c 100644 (file)
@@ -47,10 +47,11 @@ elif [ -z "$app_dirname" ]; then
   print_instructions
 fi
 
-if [[ $EUID != 0 ]]; then
-  echo "This script must be run as root or sudo."
-  exit 1
-fi
+#we will require sudo later.
+#if [[ $EUID != 0 ]]; then
+#  echo "This script must be run as root or sudo."
+#  exit 1
+#fi
 
 source "$WORKDIR/shared_site_mgr.sh"
 
@@ -66,17 +67,24 @@ else
   test_app_folder "$APPLICATION_DIR" "$app_dirname"
 fi
 
-add_domain "$DOMAIN_NAME"
+echo "!! domain being added is: $DOMAIN_NAME"
+
+sudo bash "$FEISTY_MEOW_SCRIPTS/system/add_domain.sh" "$DOMAIN_NAME"
 test_or_die "Setting up domain: $DOMAIN_NAME"
 
 sep
 
-add_apache_site "$APPLICATION_NAME" "$DOMAIN_NAME"
+sudo bash "$FEISTY_MEOW_SCRIPTS/system/add_apache_site.sh" "$APPLICATION_NAME" "$DOMAIN_NAME"
 test_or_die "Setting up apache site for: $APPLICATION_NAME"
 
 sep
 
+echo about to do powerup with: app="$APPLICATION_NAME" repo="$REPO_NAME" theme="$THEME_NAME"
+echo default repo is "$DEFAULT_REPOSITORY_ROOT" 
+
 powerup "$APPLICATION_NAME" "$REPO_NAME" "$THEME_NAME"
+# pass the real user name who should own the files.
+# "$(logname)"
 
 sep
 
index 647b87b9d8a79460679ab302371c4abe75b72a70..30ff1f50a7585056430b24733d12462aa12e6d27 100644 (file)
@@ -4,7 +4,9 @@
 
 # auto-find the scripts, since we might want to run this as sudo.
 export WORKDIR="$( \cd "$(\dirname "$0")" && /bin/pwd )"  # obtain the script's working directory.
-source "$WORKDIR/../core/launch_feisty_meow.sh"
+export FEISTY_MEOW_APEX="$( \cd "$WORKDIR/../.." && \pwd )"
+
+source "$FEISTY_MEOW_APEX/scripts/core/launch_feisty_meow.sh"
 
 # some convenient defaults for our current usage.
 
index 3c9df992983372a976865d7e91039c87b5f2d145..e6b97fb6660fda2371481e1f05742872001f8ee1 100644 (file)
@@ -8,13 +8,19 @@
 #
 # Author: Chris Koeritz
 
+export WORKDIR="$( \cd "$(\dirname "$0")" && \pwd )"  # obtain the script's working directory.
+export FEISTY_MEOW_APEX="$( \cd "$WORKDIR/../.." && \pwd )"
+
+source "$FEISTY_MEOW_APEX/scripts/core/launch_feisty_meow.sh"
+
 # some defaults that are convenient for current purposes.
-# hmmm: these would need to be parameterized somehow for this script to become really general.
+
+# hmmm: !!! these would need to be parameterized somehow for this script to become really general.
 
 # in our scheme, the single IP address that all our domains map to.
 IP_ADDRESS="10.28.42.20"
 # the email address (where first dot is replaced by @) for the administrator of the domain.
-SERVER_ADMIN="fred.cakelampvm.com"
+SERVER_ADMIN="developer.cakelampvm.com"
 # the name of the name server for the new domains (should already be configured).
 MAIN_NAME_SERVER="ns.cakelampvm.com"
 # the name of the mail server for a new domain (should already be configured).