From 5821d5de4b365ddf09626f502e1268d1769cbbcb Mon Sep 17 00:00:00 2001 From: Chris Koeritz Date: Wed, 13 Mar 2019 11:34:27 -0400 Subject: [PATCH] homing in on proper powerup behavior --- .../zippy_maps/scripts/clean_mapsdemo.sh | 42 +++++++++++++++++++ scripts/site_avenger/shared_site_mgr.sh | 25 +++++++---- 2 files changed, 59 insertions(+), 8 deletions(-) create mode 100644 production/example_apps/zippy_maps/scripts/clean_mapsdemo.sh diff --git a/production/example_apps/zippy_maps/scripts/clean_mapsdemo.sh b/production/example_apps/zippy_maps/scripts/clean_mapsdemo.sh new file mode 100644 index 00000000..e2c8755e --- /dev/null +++ b/production/example_apps/zippy_maps/scripts/clean_mapsdemo.sh @@ -0,0 +1,42 @@ +#!/bin/bash + +# some code i wrote to add to revamp that turned out to be unsuitable. +# but it corrects a problem in cakelampvm v002 release that i find annoying, +# so here it is as its own file. + +# clean out some old files that were not checked in in mapsdemo. +echo Doing some git repository maintenance in fred account. +# +# change over to fred folder +pushd /home/fred +exit_on_error "changing dir to fred's home; what have you done with fred?" + +pushd apps/mapsdemo/avenger5 +exit_on_error "changing dir to mapsdemo app" + +rpuffer . &>/dev/null +if [ $? -ne 0 ]; then + # it seems our old files are still conflicting this. + if [ -f config/config_google.php ]; then + \rm -f config/config_google.php + exit_on_error "removing old config for google" + fi + if [ -f config/app.php ]; then + \rm -f config/app.php + exit_on_error "removing old config for app" + fi + + git reset --hard HEAD + exit_on_error "resetting git's hard head" + + rpuffer . +#hmmm: use output saver thing when that exists. + exit_on_error "puffing out mapsdemo app after inadequate corrective action was taken" +fi + +popd + +popd +#...coolness, if we got to here. + + diff --git a/scripts/site_avenger/shared_site_mgr.sh b/scripts/site_avenger/shared_site_mgr.sh index 300ed3e7..d2f84e0f 100644 --- a/scripts/site_avenger/shared_site_mgr.sh +++ b/scripts/site_avenger/shared_site_mgr.sh @@ -236,6 +236,13 @@ function test_app_folder() exit_on_error "Making application directory when not already present" fi +echo yo combo is $combo + + if [ -d "$combo/$CHECKOUT_DIRNAME" ]; then + echo "Dropping expectation for intermediary checkout directory name." + unset CHECKOUT_DIRNAME + fi + locate_config_file "$dir" } @@ -276,7 +283,8 @@ function clear_orm_cache() # updates the revision control repository passed in. this expects that the # repo will live in a folder called "checkout_dirname" under the app path, -# which is the standard for our deployed sites. +# which is the standard for deployed site avenger sites. if that directory is +# missing, then we assume a checkout of the top-level repository instead. # important: this also sets a global variable called site_store_path to the full # path of the application. function update_repo() @@ -295,15 +303,19 @@ echo "$(date_stringer): $(var full_app_dir checkout_dirname repo_root repo_name) pushd "$full_app_dir" &>/dev/null exit_on_error "Switching to our app dir '$full_app_dir'" - local complete_path="$full_app_dir/$checkout_dirname" + local complete_path="$full_app_dir" + if [ ! -z "$checkout_dirname" ]; then + # make the full path using the non-empty checkout dir name. + complete_path+="/$checkout_dirname" + fi # 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 + if [ -d "$full_app_dir" ]; then # checkout directory exists, so let's check it. - pushd "$checkout_dirname" &>/dev/null - exit_on_error "Switching to our checkout directory: $checkout_dirname" + pushd "$full_app_dir" &>/dev/null + exit_on_error "Switching to directory for check out: $full_app_dir" # ask for repository name (without .git). if git rev-parse --git-dir > /dev/null 2>&1; then @@ -333,9 +345,6 @@ echo "$(date_stringer): $(var full_app_dir checkout_dirname repo_root repo_name) exit_on_error "Git clone of repository: $repo_name" fi -#not doing this here since powerup uses this and has no sudo. - #fix_site_perms "$complete_path" - #unused? # construct the full path to where the app will actually live. site_store_path="$complete_path" -- 2.34.1