Merge branch 'dev' of git://feistymeow.org/feisty_meow into dev
[feisty_meow.git] / scripts / site_avenger / standup.sh
1 #!/bin/bash
2
3 # Author: Chris Koeritz
4
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.
8
9 export WORKDIR="$( \cd "$(\dirname "$0")" && \pwd )"  # obtain the script's working directory.
10
11 ############################
12
13 function print_instructions()
14 {
15   echo
16   echo "$(basename $0 .sh) {app name}"
17   echo
18   echo "
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."
24   exit 0
25 }
26
27 ############################
28
29 # main body of script.
30
31 # check for parameters.
32 app_dirname="$1"; shift
33
34 if [ -z "$app_dirname" ]; then
35   print_instructions
36 fi
37
38 source "$WORKDIR/shared_site_mgr.sh"
39
40 if [ "$app_dirname" == "-help" -o "$app_dirname" == "--help" ]; then
41   print_instructions
42 fi
43
44 sep
45
46 check_application_dir "$APPLICATION_DIR"
47
48 add_domain "$DOMAIN_NAME"
49 test_or_die "Setting up domain: $DOMAIN_NAME"
50
51 add_apache_site "$APPLICATION_NAME" "$DOMAIN_NAME"
52 test_or_die "Setting up apache site for: $APPLICATION_NAME"
53
54 powerup "$APPLICATION_NAME" "$REPO_NAME" "$THEME_NAME"
55
56 sep
57
58 echo "
59 Finished standing up the full domain and site in:
60 ${app_dirname}"
61