-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
c0c0b5f
commit 1285417
Showing
3 changed files
with
30 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
#!/bin/bash | ||
|
||
# epoch age (in seconds) of .setup-complete | ||
SETUP_COMPLETE_AGE=$(stat -f '%c' .setup-complete); | ||
if [[ -f .setup-complete && $(($(date +%s)-SETUP_COMPLETE_AGE)) -lt 30 ]];then | ||
printf '\e[33mINFO: Performing a restart\e[0m\n' | ||
make restart | ||
|
||
printf '\e[33mINFO: Done\e[0m\n' | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
#!/bin/bash | ||
|
||
# this block forces one-time setup on entry and a reinstall if environment changes | ||
if [ ! -f .setup-complete ] || [ "$APP_ENV" != "$(cat .setup-complete)" ]; then | ||
printf '\e[33mINFO: Beginning a fresh install\e[0m\n' | ||
|
||
# composer | ||
composer install | ||
|
||
# clean first | ||
php artisan db:wipe | ||
php artisan key:generate | ||
php artisan migrate | ||
php artisan db:seed | ||
|
||
# create a control file | ||
# at minimum, this file is referenced in .gitignore and Makefile | ||
echo "$APP_ENV" > .setup-complete | ||
fi |