Last active
June 22, 2018 11:05
-
-
Save Thijzer/d658b2b94c8ea3e1a569 to your computer and use it in GitHub Desktop.
a simple script for fork CMS clean installing & testing
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
#!/bin/bash | |
# | |
# This script will remove everything and pull in the new version | |
# | |
# @version 1.0.0 | |
# @author <[email protected]> | |
# mySQL settings | |
user=$1 | |
password=$2 | |
database=$3 | |
if [ $# -eq 0 ] || [ $# -eq 1 ] || [ $# -eq 2 ] | |
then | |
echo "please supply these DB arguments <user> <password> <database>" | |
exit 1 | |
fi | |
shopt -s extglob | |
rm -rf !(.git|clean_install_fork) | |
echo 'Freddy : fork files removed' | |
git fetch | |
git reset --hard origin/master | |
# composer selfupdate # only root can update a global installed composer | |
composer install -o | |
echo 'Freddy : composer ready' | |
chmod 777 app library src -R # this step is only needed when user www-data has limited permissions | |
echo 'Freddy : removing database' | |
mysql --user="$user" --password="$password" --database="$database" --execute="DROP DATABASE $database; CREATE$ | |
echo 'Freddy : ready to install fork' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment