Last active
May 10, 2017 08:59
-
-
Save sdbruder/21716d63ba5de9fdc85fddb6fd7c68d0 to your computer and use it in GitHub Desktop.
Revisions
-
sdbruder revised this gist
May 10, 2017 . 1 changed file with 1 addition and 0 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -20,6 +20,7 @@ # - ~/src/$repo, http://$repo.app, DB $repo, all will be named accordingly; # - your homestead is in 192.168.10.10. if not, please change it below; # - you have /vagrant/scripts/serve-laravel.sh in working conditions; # - your vagrant user in homestead has a working .my.cnf configured; # - all your projects will reside on ~/src/$project on your home; # - add #LARAVEL_LIST_START somewhere in your /etc/hosts file; # -
sdbruder revised this gist
May 10, 2017 . 1 changed file with 2 additions and 1 deletion.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -33,7 +33,8 @@ sudo sed -i 'bak' '/#LARAVEL_LIST_START/a\ ' /etc/hosts # setup nginx ssh homestead "sudo bash /vagrant/scripts/serve-laravel.sh $repo.app /home/vagrant/src/$repo/public " ssh homestead "sudo service nginx restart" # create database ssh homestead 'echo "create database '"$repo"';" | mysql' -
sdbruder revised this gist
May 10, 2017 . 1 changed file with 10 additions and 6 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -1,23 +1,27 @@ #!/bin/bash ### # # newLaravelProject # # from an idea to a working freshly installed laravel in 26 seconds using # composer create-project with prestissimo. # # Sergio Bruder <[email protected]> # ### ### # # Assumptions: # # - your homestead environment will be callable as ssh homestead in your host; # - homestead points to your VM in your host and to 127.0.0.1 inside the VM; # - ~/src/$repo, http://$repo.app, DB $repo, all will be named accordingly; # - your homestead is in 192.168.10.10. if not, please change it below; # - you have /vagrant/scripts/serve-laravel.sh in working conditions; # - all your projects will reside on ~/src/$project on your home; # - add #LARAVEL_LIST_START somewhere in your /etc/hosts file; # ### -
sdbruder created this gist
May 10, 2017 .There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,58 @@ #!/bin/bash ### # newLaravelProject # # from an idea to a working freshly installed laravel in 20-ish seconds # with a composer create-project with prestissimo. # ### ### # # Assumptions: # # - all your projects will reside on ~/src/$project on your home # - your homestead environment will be callable as ssh homestead in your host; # - homestead points to your homestead in your host and points to 127.0.0.1 # inside your homestead; # - you have /vagrant/scripts/serve-laravel.sh in working conditions; # - ~/src/$repo, http://$repo.app, DB $repo, all will be named accordingly; # ### repo=$1 # change /etc/hosts sudo sed -i 'bak' '/#LARAVEL_LIST_START/a\ 192.168.10.10 '"$repo"'.app ' /etc/hosts # setup nginx ssh homestead "sudo bash /vagrant/scripts/serve-laravel.sh $repo.app /home/vagrant/src/$repo/public ; sudo service nginx restart" # create database ssh homestead 'echo "create database '"$repo"';" | mysql' # composer install the laravel project cd ~/src composer create-project --prefer-dist laravel/laravel $repo # change .env to point to mysql in homestead cd ~/src/$repo sed -i 'bak' "s/DB_HOST=.*/DB_HOST=homestead/g" .env sed -i 'bak' "s/DB_DATABASE=.*/DB_DATABASE=$repo/g" .env # initial migrations php artisan migrate # initial commit cd ~/src/$repo git init . git add -A . git commit -m 'initial commit' # open url in the browser open "http://$repo.app" echo "$repo project started, happy Laraveling."