Last active
June 24, 2020 19:43
-
-
Save Braunson/f7205b83bef1acfb2fe833fdefd30271 to your computer and use it in GitHub Desktop.
Slightly modified version of https://raw.githubusercontent.com/grrnikos/pma/master/pma.sh to support one argument, the URL to serve the site on.
This file contains hidden or 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 | |
LATEST_VERSION=$(curl -sS 'https://api.github.com/repos/phpmyadmin/phpmyadmin/releases/latest' | awk -F '"' '/tag_name/{print $4}') | |
DOWNLOAD_URL="https://api.github.com/repos/phpmyadmin/phpmyadmin/tarball/$LATEST_VERSION" | |
SERVE_URL=${1:-phpmyadmin.local} | |
echo "Downloading phpMyAdmin $LATEST_VERSION" | |
wget $DOWNLOAD_URL -q -O 'phpmyadmin.tar.gz' | |
mkdir phpmyadmin && tar xf phpmyadmin.tar.gz -C phpmyadmin --strip-components 1 | |
rm phpmyadmin.tar.gz | |
# Create an SSL Cert and site instance | |
echo "Serving the domain: $1" | |
# As per https://github.com/laravel/homestead/issues/1439#issuecomment-649013549 | |
# serve-laravel $SERVE_URL $(pwd)/phpmyadmin | |
bash /vagrant/scripts/create-certificate.sh "$SERVE_URL" | |
dos2unix /vagrant/scripts/site-types/laravel.sh | |
bash /vagrant/scripts/site-types/laravel.sh "$SERVE_URL" "$(pwd)/phpmyadmin" 80 443 "7.4" | |
echo "Installing dependencies for phpMyAdmin on $1" | |
cd phpmyadmin && composer update --no-dev --quiet --no-interaction && yarn | |
echo "Setting the proper ownership" | |
chown -R vagrant:vagrant $(pwd)/phpmyadmin | |
sudo service nginx reload |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Usage
You would use it like this:
or for a shorter snippet
Place this in either
after.sh
oruser-customizations.sh
scripts if your using Laravel Homestead