Last active
January 10, 2017 00:40
-
-
Save kilrizzy/e2cd720134a3f3a42e98426786359ea0 to your computer and use it in GitHub Desktop.
Automate Homestead (host sitekey site/directory)
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 | |
KEY=$1 | |
DIRECTORY=$2 | |
DOMAIN=$KEY".app" | |
DATABASE=$KEY | |
/bin/bash /c/scripts/add-site.sh $DOMAIN $DIRECTORY $DATABASE |
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 | |
DOMAIN=$1 | |
DIRECTORY=$2 | |
DATABASE=$3 | |
printf "\n192.168.10.10 ${DOMAIN}" >> "/c/Windows/System32/drivers/etc/hosts" | |
sed -i "/sites:/a \ \ \ \ - map: ${DOMAIN}\r\n\ \ \ \ \ \ to: /home/vagrant/www/${DIRECTORY}/public" "/c/.homestead/Homestead.yaml" | |
sed -i "/databases:/a \ \ \ \ - ${DATABASE}" "/c/.homestead/Homestead.yaml" | |
cd "/c/Homestead" | |
vagrant provision |
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
host=bash C:\scripts\add-site-key.sh $1 $2 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment