Libraries and Version Controllers |
Hello, I have a few libraries I using in more then one project of Codeigniter. Every project using own git container and own git backup.
Sometimes I need to update library and wants this library automaticaly updated on every of my project in git after commiting. How can I organise this? I has tried with git modules, but something goes wrong with location of library files and updating on every project, may be it's not working properly.
I actually use the CodeIgniter Package system http://www.codeigniter.com/userguide3/li...ckage_path to place all my "common" or "shared" libraries, helpers, models, and views (actually I can put controllers in there but the CodeIgniter packages code won't handle those without some help). Then I manage those in a separate GIT repro. Since it's a completely separate folder it might be a little easier for you?
I tried the composer way but managing the package in a private repro and not in packgist seemed like more of a pain. If you don't mind your code being public and publishing it on packgist it's a lot easier. Unfortunately some in the PHP community (not to be named here) think packgist is overrun with "worthless" code. Personally the amount of "choices" doesn't bother me.
Composer is working as uploader in one way. It uploads package from git, can detect updates in remote branch. And can't update pull request.
Negative side of this - I must use git inside of git, update both git then php composer update is taken effect. Or change path to libraries and modules to outside of project folder and use one folder to all of my projects as *dmyers* tips. May be I should use second "codeigniter packages method" for now and wait another workable application. Thanks
You could always use Webhooks in GitHub, if you're using that, to update a URL and have it pull a new version down.
You could also create a git hook on push and shoot the changes (or even just a notice) to your other sites. Other than that, I don't know of a way to make it happen automatically. If you package things up as a Composer-loadable library, instead of a strictly CI one, you could simply do a composer update on each project when you work on it again. You could even use Composer and CodeIgniter Installers to pull your package down and throw the library in your libraries, or third-party folder for you. That's possibly the best solution, in my opinion. |
Welcome Guest, Not a member yet? Register Sign In |