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.
11 ############################
13 function print_instructions()
16 echo "$(basename $0 .sh) {app name}"
19 app name: The app name parameter is mandatory. The configuration file for
20 this script will be derived from the app name (e.g. if the app name is MyApp,
21 then the config file will be 'MyApp.config'). The config files are by
22 convention stored in the 'config' directory. The configuration file can be
23 overridden by setting the SITE_MANAGEMENT_CONFIG_FILE environment variable."
27 ############################
29 # main body of script.
31 # check for parameters.
32 app_dirname="$1"; shift
34 if (( $EUID != 0 )); then
35 echo "This script must be run as root or sudo."
39 if [ -z "$app_dirname" ]; then
43 source "$WORKDIR/shared_site_mgr.sh"
45 if [ "$app_dirname" == "-help" -o "$app_dirname" == "--help" ]; then
51 check_application_dir "$APPLICATION_DIR"
53 add_domain "$DOMAIN_NAME"
54 test_or_die "Setting up domain: $DOMAIN_NAME"
56 add_apache_site "$APPLICATION_NAME" "$DOMAIN_NAME"
57 test_or_die "Setting up apache site for: $APPLICATION_NAME"
59 powerup "$APPLICATION_NAME" "$REPO_NAME" "$THEME_NAME"
64 Finished standing up the full domain and site in: