updating cakephp apps
[feisty_meow.git] / production / example_apps / zippy_maps / prepare_project.sh
1 #!/bin/bash
2
3 # bails if any step fails.
4 function check_result() {
5   if [ $? -ne 0 ]; then
6     echo -e "failed on: $*"
7     error_sound
8     exit 1
9   fi
10 }
11
12
13 echo running composer update process...
14 composer update
15 check_result "updating project with composer"
16
17 ## echo copying in updated cakephp-geo google maps helper code.  this should be unnecessary when they update upstream for static map fix.
18 ## cp -fv ./updates_pending/cakephp-geo/src/View/Helper/GoogleMapHelper.php ./vendor/dereuromark/cakephp-geo/src/View/Helper/GoogleMapHelper.php
19 ## check_result "copying the updated google maps helper file"
20
21 echo -e "\n\nHave the two config files app.php and config_google.php been configured yet AND has the database for the app been added to mysql? (y/N)"
22 read line
23
24 if [ $line != 'y' -a $line != 'Y' -a $line != 'yes' -a $line != 'YES' ]; then
25   echo "Please configure the two config files using their default versions as templates (see the config directory for app.default.php and config_google.default.php)"
26   exit 1
27 fi
28
29 echo running migration code to build the database...
30 ./bin/cake migrations migrate
31 check_result "running the database migrations"
32
33
34