config file should be able to provide everything now.
sep
-check_application_dir "$APPLICATION_DIR"
+check_application_dir "$BASE_APPLICATION_PATH"
# find proper webroot where the site will be initialized.
if [ -z "$app_dirname" ]; then
# no dir was passed, so guess it.
- find_app_folder "$APPLICATION_DIR"
+ find_app_folder "$BASE_APPLICATION_PATH"
else
- test_app_folder "$APPLICATION_DIR" "$app_dirname"
+ test_app_folder "$BASE_APPLICATION_PATH" "$app_dirname"
fi
# where we expect to find our checkout folder underneath.
-full_app_dir="$APPLICATION_DIR/$app_dirname"
+full_app_dir="$BASE_APPLICATION_PATH/$app_dirname"
# simplistic approach here; just go to the folder and pull the changes.
# basic information that is constant for all site avenger sites.
-export APPLICATION_DIR="$HOME/apps"
+# the top level of the user's application storage.
+export BASE_APPLICATION_PATH="$HOME/apps"
+# where the code should come from.
export DEFAULT_REPOSITORY_ROOT="git@github.com:kwentworth"
+# we checkout the git repository to a directory underneath the
+# app storage directory named this:
export CHECKOUT_DIR_NAME="avenger5"
+# the subfolder that the web browser will look for the site in,
+# underneath the application's specific path.
+export STORAGE_SUFFIX="/public"
+
+####
+
+# constants within our cakelampvm machine.
+
+# in our scheme, the single IP address that all our domains map to.
+export IP_ADDRESS="10.28.42.20"
+# the email address (where first dot is replaced by @) for the administrator of the domain.
+export SERVER_ADMIN="developer.cakelampvm.com"
+# the name of the name server for the new domains (should already be configured).
+export MAIN_NAME_SERVER="ns.cakelampvm.com"
+# the name of the mail server for a new domain (should already be configured).
+export MAIL_SERVER="mail.cakelampvm.com"
+# the distribution name to be listed in info for the new domain or subdomain.
+export DISTRO="ubuntu"
####
sep
-check_application_dir "$APPLICATION_DIR"
+check_application_dir "$BASE_APPLICATION_PATH"
# find proper webroot where the site will be initialized.
if [ -z "$app_dirname" ]; then
# no dir was passed, so guess it.
- find_app_folder "$APPLICATION_DIR"
+ find_app_folder "$BASE_APPLICATION_PATH"
else
- test_app_folder "$APPLICATION_DIR" "$app_dirname"
+ test_app_folder "$BASE_APPLICATION_PATH" "$app_dirname"
fi
# where we expect to find our checkout folder underneath.
-full_app_dir="$APPLICATION_DIR/$app_dirname"
+full_app_dir="$BASE_APPLICATION_PATH/$app_dirname"
# use our default values for the repository and theme if they're not provided.
if [ -z "$repo_name" ]; then
#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"
+# chown -R "$user_name:$user_name" "$BASE_APPLICATION_PATH"
+# test_or_die "Chowning $BASE_APPLICATION_PATH to be owned by $user_name"
#fi
sep
sep
-check_application_dir "$APPLICATION_DIR"
+check_application_dir "$BASE_APPLICATION_PATH"
# find proper webroot where the site will be initialized.
if [ -z "$app_dirname" ]; then
# no dir was passed, so guess it.
- find_app_folder "$APPLICATION_DIR"
+ find_app_folder "$BASE_APPLICATION_PATH"
else
- test_app_folder "$APPLICATION_DIR" "$app_dirname"
+ test_app_folder "$BASE_APPLICATION_PATH" "$app_dirname"
fi
# where we expect to find our checkout folder underneath.
-full_app_dir="$APPLICATION_DIR/$app_dirname"
+full_app_dir="$BASE_APPLICATION_PATH/$app_dirname"
# use our default values for the repository and theme if they're not provided.
if [ -z "$repo_name" ]; then
sep
-check_application_dir "$APPLICATION_DIR"
+check_application_dir "$BASE_APPLICATION_PATH"
# find proper webroot where the site will be initialized.
if [ -z "$app_dirname" ]; then
# no dir was passed, so guess it.
- find_app_folder "$APPLICATION_DIR"
+ find_app_folder "$BASE_APPLICATION_PATH"
else
- test_app_folder "$APPLICATION_DIR" "$app_dirname"
+ test_app_folder "$BASE_APPLICATION_PATH" "$app_dirname"
fi
# where we expect to find our checkout folder underneath.
-full_app_dir="$APPLICATION_DIR/$app_dirname"
+full_app_dir="$BASE_APPLICATION_PATH/$app_dirname"
# use our default values for the repository and theme if they're not provided.
if [ -z "$repo_name" ]; then
sep
-check_application_dir "$APPLICATION_DIR"
+check_application_dir "$BASE_APPLICATION_PATH"
# find proper webroot where the site will be initialized.
if [ -z "$app_dirname" ]; then
# no dir was passed, so guess it.
- find_app_folder "$APPLICATION_DIR"
+ find_app_folder "$BASE_APPLICATION_PATH"
else
- test_app_folder "$APPLICATION_DIR" "$app_dirname"
+ test_app_folder "$BASE_APPLICATION_PATH" "$app_dirname"
fi
#echo "!! domain being added is: $DOMAIN_NAME"
# some convenient defaults for our current usage.
-BASE_PATH="$HOME/apps"
-STORAGE_SUFFIX="/public"
+if [ -z "$BASE_APPLICATION_PATH" ]; then
+ BASE_APPLICATION_PATH="$HOME/apps"
+fi
+if [ -z "$STORAGE_SUFFIX" ]; then
+ STORAGE_SUFFIX="/public"
+fi
# this function writes out the new configuration file for the site.
function write_apache_config()
if [ -z "$site_path" ]; then
# path where site gets checked out, in some arcane manner, and which happens to be
# above the path where we put webroot (in the storage suffix, if defined).
- local path_above="${BASE_PATH}/${appname}"
+ local path_above="${BASE_APPLICATION_PATH}/${appname}"
# no slash between appname and suffix, in case suffix is empty.
local full_path="${path_above}${STORAGE_SUFFIX}"
#echo really full path is $full_path
function maybe_create_site_storage()
{
local our_app="$1"; shift
- # make sure the base path for storage of all the apps for this user exists.
- local full_path="$BASE_PATH/$our_app"
+ # make sure the path for storage this app exists for the user.
+ local full_path="$BASE_APPLICATION_PATH/$our_app"
if [ ! -d "$full_path" ]; then
mkdir -p $full_path
test_or_die "The app storage path could not be created.\n Path in question is: $full_path"
appropriate name for a file-system compatible folder name. There is an
optional third parameter (3) the path for site storage. If the site path
is not provided, we'll use this path:
- $BASE_PATH/{app name}/$STORAGE_SUFFIX"
+ $BASE_APPLICATION_PATH/{app name}/$STORAGE_SUFFIX"
exit 1
fi
source "$FEISTY_MEOW_APEX/scripts/core/launch_feisty_meow.sh"
# some defaults that are convenient for current purposes.
+# existing values will be respected over our defaults.
-# 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="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).
-MAIL_SERVER="mail.cakelampvm.com"
-# the distribution name to be listed in info for the new domain or subdomain.
-DISTRO="ubuntu"
+if [ -z "$IP_ADDRESS" ]; then
+ # in our scheme, the single IP address that all our domains map to.
+ IP_ADDRESS="10.28.42.20"
+fi
+if [ -z "$SERVER_ADMIN" ]; then
+ # the email address (where first dot is replaced by @) for the administrator of the domain.
+ SERVER_ADMIN="developer.cakelampvm.com"
+fi
+if [ -z "$MAIN_NAME_SERVER" ]; then
+ # the name of the name server for the new domains (should already be configured).
+ MAIN_NAME_SERVER="ns.cakelampvm.com"
+fi
+if [ -z "$MAIL_SERVER" ]; then
+ # the name of the mail server for a new domain (should already be configured).
+ MAIL_SERVER="mail.cakelampvm.com"
+fi
+if [ -z "$DISTRO" ]; then
+ # the distribution name to be listed in info for the new domain or subdomain.
+ DISTRO="ubuntu"
+fi
# creates a totally new domain config file for DNS.
function write_new_domain_file()