3 # Author: Chris Koeritz
5 # This is the full orchestrator for bringing up a web site using our site
6 # management scripts. So far, the scripts rely on at least php. The support
7 # is much more powerful if the site is based on cakephp and site avenger.
9 export WORKDIR="$( \cd "$(\dirname "$0")" && \pwd )" # obtain the script's working directory.
10 export FEISTY_MEOW_APEX="$( \cd "$WORKDIR/../.." && \pwd )"
12 source "$FEISTY_MEOW_APEX/scripts/core/launch_feisty_meow.sh"
14 ############################
16 function print_instructions()
19 echo "$(basename $0 .sh) {app name}"
22 $(basename $0 .sh) will completely set up a web site, including a domain
23 name and an apache configuration file. The site will be acquired from a
24 git repository and configured. At the end of this script, the result should
25 be an almost working website; you may need to fix the site configuration,
26 create databases and so forth.
28 This script must be run as sudo or root; it makes changes to system files.
29 app name: The app name parameter is mandatory. The configuration file for
30 this script will be derived from the app name (e.g. if the app name is MyApp,
31 then the config file will be 'MyApp.config'). The config files are by
32 convention stored in the 'config' directory. The configuration file can be
33 overridden by setting the SITE_MANAGEMENT_CONFIG_FILE environment variable."
37 ############################
39 # main body of script.
41 # check for parameters.
42 app_dirname="$1"; shift
44 if [ "$app_dirname" == "-help" -o "$app_dirname" == "--help" ]; then
46 elif [ -z "$app_dirname" ]; then
50 if [[ $EUID != 0 ]]; then
51 echo "This script must be run as root or sudo."
55 source "$WORKDIR/shared_site_mgr.sh"
59 check_application_dir "$APPLICATION_DIR"
61 # find proper webroot where the site will be initialized.
62 if [ -z "$app_dirname" ]; then
63 # no dir was passed, so guess it.
64 find_app_folder "$APPLICATION_DIR"
66 test_app_folder "$APPLICATION_DIR" "$app_dirname"
69 add_domain "$DOMAIN_NAME"
70 test_or_die "Setting up domain: $DOMAIN_NAME"
74 add_apache_site "$APPLICATION_NAME" "$DOMAIN_NAME"
75 test_or_die "Setting up apache site for: $APPLICATION_NAME"
79 powerup "$APPLICATION_NAME" "$REPO_NAME" "$THEME_NAME"
84 Finished standing up the full domain and site in: