Last active
May 7, 2018 00:03
-
-
Save hariadi/101c04f4bab1f5f7667b2b9e8ce5baf2 to your computer and use it in GitHub Desktop.
Install PhpMyAdmin on Laravel Homestead
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 | |
PHPMY="phpmyadmin" | |
OLDPHPMY=$PHPMY-$(date +%F-%H) | |
echo 'Check PMA latest release' | |
TARBALL_URL=$(curl -s https://api.github.com/repos/phpmyadmin/phpmyadmin/releases/latest 2>&1 | grep -oP '(?<="tarball_url":).*?[^\\],' | tr -d ",\"") | |
echo "Downloading $TARBALL_URL..." | |
#echo -ne '##### (33%)\r' | |
#sleep 1 | |
#echo -ne '############# (66%)\r' | |
#sleep 1 | |
#echo -ne '####################### (100%)\r' | |
#echo -ne '\n' | |
curl -#SL $TARBALL_URL -o $PHPMY.tar.gz | |
echo "Move old $PHPMY" | |
mv $PHPMY $OLDPHPMY | |
echo "Exracting.." | |
mkdir -p $PHPMY && tar xf $PHPMY.tar.gz -C $PHPMY --strip-components 1 | |
cp -r $OLDPHPMY/vendor $PHPMY/ | |
cd $PHPMY | |
composer install | |
# rm phpmyadmin.tar.gz | |
echo "Serving web server" | |
CMD=/vagrant/scripts/serve-laravel.sh | |
if [ ! -f $CMD ]; then | |
# fallback for older versions | |
CMD=/vagrant/scripts/serve.sh | |
fi | |
sudo bash $CMD phpmyadmin.app $(pwd)/phpmyadmin | |
echo "Done" | |
exit |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
sh pma.sh