$30 off During Our Annual Pro Sale. View Details »

Maintaining Homestead

Maintaining Homestead

Laravel's Homestead project is the second most downloaded public Vagrant environment. Initially designed to be a full-featured local development environment focused on making Laravel developer's experience easier Homestead has grown into a solid, well-rounded LAMP stack Vagrant environment for nearly any PHP project.

Join us as we review the features and inner workings of Homestead, explore some features you may not be aware of, and even take a trip deep into the operations process of how we build and deliver the best vagrant environment for the PHP community. We'll also cover extending Homestead and making it work for your custom applications and how you can easily share the customized environment with your teammates, coworkers, or contributors.

Joe Ferguson

June 01, 2018
Tweet

More Decks by Joe Ferguson

Other Decks in Technology

Transcript

  1. Maintaining
    Homestead
    Joe Ferguson
    June 1st 2018

    View Slide

  2. Who Am I?
    Joe Ferguson
    PHP Developer
    PHP Architect @ Ministry Brands
    Twitter: @JoePFerguson
    OSMI Board Member
    Drone Racing Pilot

    View Slide

  3. vagrantup.com

    View Slide

  4. Homestead Principles
    Easy to use
    First class Laravel support
    Support all 3 major Operating Systems
    Flexible and extendable
    Fast to start up

    View Slide

  5. Local Dev Environment

    View Slide

  6. Just Use Docker

    View Slide

  7. Vagrant Providers

    View Slide

  8. Vagrant uses
    Virtualbox’s API

    View Slide

  9. Vagrant Boxes

    View Slide

  10. Vagrant Boxes

    View Slide

  11. Adding Vagrant Boxes

    View Slide

  12. Updating Vagrant Boxes

    View Slide

  13. Installed Vagrant Boxes

    View Slide

  14. Lots of Users

    View Slide

  15. What’s in Homestead
    •Ubuntu 18.04
    •PHP 5.6
    •PHP 7.0
    •PHP 7.1
    •PHP 7.2
    •Nginx
    •MySQL
    •MariaDB
    •Sqlite3
    •Postgres
    •MailHog
    •Composer
    •NodeJS
    •Bower
    •Grunt
    •Gulp
    •Beanstalkd
    •Memcached

    View Slide

  16. Getting Homestead
    git clone https://github.com/laravel/homestead.git Homestead

    View Slide

  17. Getting Homestead
    cd Homestead && bash init.sh

    View Slide

  18. How I use Homestead
    composer require —dev laravel/homestead

    View Slide

  19. Make Homestead
    ./vendor/bin/homested make

    View Slide

  20. Configuring Homestead

    View Slide

  21. Configuring Homestead

    View Slide

  22. Configuring Homestead

    View Slide

  23. Do Not Do This

    View Slide

  24. Configuring Homestead

    View Slide

  25. Configuring Homestead

    View Slide

  26. More Configuration

    View Slide

  27. Starting Homestead

    View Slide

  28. Inspecting Homestead

    View Slide

  29. Edit /etc/hosts
    Optional for per project Homestead

    View Slide

  30. Inspecting Homestead

    View Slide

  31. Inspecting Homestead

    View Slide

  32. Stopping Homestead

    View Slide

  33. Don’t version control
    Homestead.yaml

    View Slide

  34. Customizing Homestead

    View Slide

  35. after.sh

    View Slide

  36. Peeking under the hood

    View Slide

  37. View Slide

  38. Powered By

    View Slide

  39. Vagrantfile

    View Slide

  40. Vagrantfile

    View Slide

  41. scripts/homestead.rb

    View Slide

  42. Setup and Configure

    View Slide

  43. Configure Networking

    View Slide

  44. VirtualBox Settings

    View Slide

  45. VMware Settings

    View Slide

  46. Parallels Settings

    View Slide

  47. Configure Ports

    View Slide

  48. Configure Ports & Key

    View Slide

  49. Copy SSH Keys

    View Slide

  50. Copy Files

    View Slide

  51. Map Folders

    View Slide

  52. Clear any existing nginx

    View Slide

  53. Configure Sites

    View Slide

  54. Create Sites

    View Slide

  55. Configure Cron Jobs

    View Slide

  56. Configure Variables

    View Slide

  57. Install optional software

    View Slide

  58. CouchDB & Elasticsearch

    View Slide

  59. Configure Databases

    View Slide

  60. Configure Blackfire

    View Slide

  61. Setup ngrok

    View Slide

  62. scripts/serve-laravel.sh

    View Slide

  63. scripts/create-mysql.sh

    View Slide

  64. Site Types
    apache
    laravel (default)
    elgg
    crystal
    pimcore
    spa
    proxy (nginx)
    silverstripe
    statamic
    symfony2 / 4
    zf /expressive
    apigility

    View Slide

  65. PHP Versions

    View Slide

  66. PHP Versions

    View Slide

  67. How do you deliver a feature
    rich Vagrant box that boots in
    ~1 minute?

    View Slide

  68. Laravel Settler

    View Slide

  69. Laravel Settler

    View Slide

  70. packer.io

    View Slide

  71. packer.io

    View Slide

  72. Bento Boxes
    http://chef.github.io/bento/

    View Slide

  73. Building Homestead
    Copy provision script to bento repo

    View Slide

  74. Building with Packer

    View Slide

  75. Build Output

    View Slide

  76. Testing Our Build

    View Slide

  77. Testing Our Build

    View Slide

  78. Testing Our Build

    View Slide

  79. Testing Our Build

    View Slide

  80. Ship It!

    View Slide

  81. Warning for Windows

    View Slide

  82. Contributing
    Encourage new contributors
    Creating new site types is easy
    Adding “bolt on” features like ElasticSearch,
    Apache, MariaDB, etc

    View Slide

  83. Contributing

    View Slide

  84. Joe Ferguson
    Twitter: @JoePFerguson
    Email: [email protected]
    Freenode: joepferguson
    Contact Info:
    https://joind.in/talk/e58c1

    View Slide