Uploading Specific Vendor files with Laravel's Envoyer
Asked Answered
V

1

9

I'm trying to upload only specific vendor files to my server using Laravel Forge. The reason is because I've edited the code in some of my dependencies, whats happening now is that certain features of my site are breaking because when I push from Envoyer to my server , Envoyer is grabbing from my GitHub repo.

my GitHub repo doesn't contain a vendor directory, as it shouldn't because Iv'e added that directory to my gitignore file

/vendor/*
/node_modules
Homestead.yaml
Homestead.json
.env

I've tried white listing certain folders within the directory like so:

/vendor/*
/node_modules
Homestead.yaml
Homestead.json
.env
!/vendor
!/vendor/misd

But then after I deploy from Envoyer to my server, My site stops working and I get an error message

Warning: require(/home/forge/default/bootstrap/../vendor/autoload.php): failed to open stream: No such file or directory in /home/forge/default/bootstrap/autoload.php on line 17

I've tried including the autoload.php file in the white list, but still get a similar message after deploying

How can I upload my versions of dependencies (the dependencies I edited). Whats happening now is that Envoyer is grabbing all the dependencies via composer, thus grabbing from the dependencies repo, thats great but, I need to be able to install my own versions of some of those dependencies

any Ideas

Villous answered 23/2, 2017 at 12:17 Comment(2)
Never, EVER edit files in your vendor folder. Seriously, If you've done this, you are stepping into a whole world of pain and should consider refactoring to avoid it rather than trying to fight against a well established deployment system which is based almost entirely on the fact that nobody edits files in the vendor folder.Allseed
Instead of editing files from your vendor, try extending the package and if not possible, fork the project and start your own package.Chico
N
0

As mentioned in the comments on the question itself this is a pretty dangerous situation and you'd be much better served extending the package or forking it and then using that.

That being said it does look like you have a git issue: Based solely on the error you're getting the problem appears as if it's less that you aren't including the module files (have you actually checked that the module files are present?) and more that /home/forge/default/bootstrap/../vendor/autoload.php isn't present. Based on the .gitignore you provide this is correct (You ignore all files in vendor--/vendor/*--and only include back the directory itself--!/vendor--and the subdirectory/file misd--!/vendor/misd). You either need to include /vendor/autoload.php--!/vendor/autoload.php--or you need to generate it after the fact some how.

Nonchalant answered 1/6, 2017 at 22:25 Comment(1)
Actually, she could also simply force-add the files she wants. As soon as a file is tracked, it is tracked and .gitignore is irrelevant. And you can always force-add a file even if it is ignored.Dugout

© 2022 - 2024 — McMap. All rights reserved.