forked from laravelio/laravel.io
-
Notifications
You must be signed in to change notification settings - Fork 0
/
update_environment.sh
executable file
·45 lines (35 loc) · 1.02 KB
/
update_environment.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
#!/bin/bash
chmod -R 777 app/storage
# update the composer binary
if [ `hostname -s` == "quantal64" ]; then
php ./composer.phar self-update
fi
# have to run this before any laravel code is run
php ./composer.phar dump-autoload
# delete compiled classes file
if [ ! -n bootstrap/compiled.php ]; then
rm bootstrap/compiled.php
fi
# bring up the maintenance site
if [ `hostname -s` != "quantal64" ]; then
php artisan down
fi
# install composer packages
php ./composer.phar install --no-scripts
# migrate and seed both databases
if [ `hostname -s` != "quantal64" ]; then
php artisan migrate --env=production
php artisan migrate --package=mccool/laravel-slugs --env=production
php artisan db:seed --env=production
else
php artisan migrate --env=local
php artisan migrate --package=mccool/laravel-slugs --env=local
php artisan db:seed --env=local
fi
# create laravel optimized autoloader
php artisan dump-autoload
# bring the site back up
if [ `hostname -s` != "quantal64" ]; then
php artisan up
fi
exit 0