Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Proposal: user-specific files #932



Copy link

@stevegrunwell stevegrunwell commented Aug 31, 2018

I'm a huge fan of the convention, which really lets me streamline the setup of an application (I tend to use per-project Homestead installations); picking up one of my Laravel apps usually looks like:

  1. Clone the git repo
  2. Install Composer dependencies
  3. $ vendor/bin/homestead make
  4. $ vagrant up (with handling migrations, seeding, etc.)
  5. $ vagrant ssh

β€” then start building awesome stuff!

The script is great to ensure that new VMs automatically get system requirements and let me save developers a step in running migrations/seeders. Of course, developers are an opinionated bunch, so I find myself running this anytime I rebuild the VM:

# Replace nano with a much better editor πŸ’₯
$ sudo update-alternatives --set editor /usr/bin/vim.basic

For developers more dependent on their own, more-unique aliases, it's nice to have a way to set user-specific settings automatically in a script that's not tracked under version control.

This PR introduces just that, in the form of an file: when present, the file will be executed immediately following the file (though the two are not tied to one another). Nothing is generated automatically, but developers who want to be able to fully customize the VM without losing their work with each rebuild, is πŸ‘Œ

Alternate approach

If the maintainers/community find that this doesn't add enough value, I'll also leave the less-canonical implementation for teams that would benefit from this concept:


# Load developer-specific commands.
if [ -e ]; then
Copy link

@svpernova09 svpernova09 left a comment

Not a fan of "after local" but it does drive what you're wanting out of this. What do you think about calling it "` or similar? I think that would be a bit better description of what we're trying to accomplish here.

@@ -38,6 +39,10 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
config.vm.provision "shell", path: afterScriptPath, privileged: false, keep_color: true

if File.exist? afterLocalScriptPath then
config.vm.provision "shell", path: afterScriptPath, privileged: false, keep_color: true

This comment has been minimized.


svpernova09 Aug 31, 2018

This should be path: afterLocalScriptPath

…r* ``, help assign more meaning to it with the name ``
Copy link
Contributor Author

@stevegrunwell stevegrunwell commented Sep 2, 2018

Phew, I wasn't particularly attached to, but was having trouble coming up with a better name; gives it a much clearer meaning πŸ‘

PR has been updated to use the new name and address the missed copy/paste error in resources/localized/Vagrantfile.

Copy link

@svpernova09 svpernova09 commented Sep 2, 2018

@svpernova09 svpernova09 merged commit c123d98 into laravel:master Sep 2, 2018
2 checks passed
2 checks passed
continuous-integration/styleci/pr The analysis has passed
continuous-integration/travis-ci/pr The Travis CI build passed
Copy link

@svpernova09 svpernova09 commented Sep 2, 2018

Thanks for the PR and changes. Looking forward to implementing this in my own projects.

@stevegrunwell stevegrunwell deleted the stevegrunwell:feature/after-local-script branch Sep 4, 2018
njbarrett pushed a commit to JuiceboxCreative/localbox that referenced this pull request Oct 22, 2018
* upstream/master:
  Add Load Balancer (laravel#957)
  add header support (laravel#955)
  πŸ’Ž πŸ”– Tagging v7.18.0
  Increase the configuration of the thinkphp framework (laravel#952)
  Fix error message for missing Homestead settings (laravel#950)
  hyperv : use linked_clone instead of deprecated differencing_disk option (laravel#946)
  Backup mysql functions and procedures (laravel#945)
  🚧 WIP work on Rails support. Current issue is nginx compatibility (laravel#944)
  ✨ Add support for 'aspdotnetcore' site type (laravel#941)
  πŸ’Ž πŸ”– Tagging version 7.17.0
  Apache HTTP/HTTPS php version fix (laravel#940)
  Create minio buckets via config (laravel#939)
  πŸ’Ž πŸ”– Tagging 7.16.1
  πŸš‘ Fix typo breaking older versions of Vagrant < 2.1.0 (laravel#935)
  Proposal: user-specific files (laravel#932)
  Install the latest version of neo4j rather than a specific version. (laravel#933)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

2 participants