Attached patch auto clones Glip right after git_deploy is enabled (if not already present). To do so, I had to change the requirements check so that it operated at runtime, not install time. At install time, we don't quite have Glip yet ... Also adds a command to get Glip if user wants to do that separately or enabled on the web and now wants the dependency using drush.
I changed the storage of Glip to the git_deploy folder in the case when Libraries module is not present. Thats my understanding of how things should work. Libraries best practices for PHP libraries are not so clear for me. The patch implements what devel has done with FirePHP library for a long time. The case where Libraries module is present has not changed.
| Comment | File | Size | Author |
|---|---|---|---|
| #10 | git_deploy.diff | 1.81 KB | lsiden |
| #2 | 0001-Add-drush-integration-for-automatically-downloading-.patch | 5.47 KB | moshe weitzman |
| 0001-Add-drush-integration-for-automatically-downloading-.patch | 5.44 KB | moshe weitzman |
Comments
Comment #1
Freso commentedThe patch looks sound, and the approach can even be backported to 6.x, to remove the hard dependency on Libraries.
There are a few minor coding style issues though, plus some random comments:
Should be using single quotes. There's nothing that requires the double quotes, and you're using single quotes elsewhere in the patch...
This could probably be more descriptive.
I'm pretty sure we want git_deploy's function to start with
git_deploy_(or_git_deploy_). Usingdrush_git_deploy_FOOmight cause issue with a possible futurehook_git_deploy_FOO()Space between
'/'and.. :)Perhaps cloning via the HTTPS might be safer choice? I know my current network doesn't allow traffic on the Git (or CVS or Svn or ...) port, but accepts HTTP[S] happily. It's the same repos, but might be accessible to more people. :)
Hm. I have a feeling this really belongs in another issue. I like it, but how is it required for (or at least related to) the feature request at hand?
Powered by Dreditor.
Comment #2
moshe weitzman commentedThanks for the review. All fixed except for:
drush_git_deploy_download() has a function name as specified by drush's callback system. I don't think it is worthwhile to bypass that in favor of a hypothetical name conflict in the future.
That last hunk is actually required. This module has to not throw errors if the Glip library is not present. The system_alter hook actually fires in between when the module is enabled and drush downloads the library. The line you've qouted prevents us from throwing an error in this brief time period.
Comment #3
halstead commentedThis section was leaving out a '/' separator so I added it and I also create the libraries directory if it doesn't already exist.
I've committed it at http://drupalcode.org/project/git_deploy.git/commit/af5ac3d please update here if I've missed anything.
Thanks a lot. This is so convenient.
Powered by Dreditor.
Comment #4
Freso commentedIf one is using git-submodule to track the additions of various contrib modules, themes, ... and external libraries, this could cause some trouble in cloning Glip "outside" git-submodule.
Git will see the newly made directory and recognise it as an untracked file (see http://pastie.org/1661462), however, you can't tell git-submodule to add it, unless you also give it the repository URL - and you might as well simply have started off by git-submodule add'ing it.
I'm not really sure of what to do though. Should we check for .gitmodules, and use git-submodule add instead of git-clone if it exists? Should it be a Drush option? A combination? Something else?
I've no idea what the prevailing way of Git-managing sites is, but automatically fetching Glip would cause some annoyance in my workflow.
Comment #5
halstead commentedWe now need to get this functionality into 6.x as well.
Comment #6
sdboyer commentedAny value to putting glip directly into drush somewhere, then selectively including it? Like, maybe an spl_autoload_register()'d function for getting glip in, then (potentially - I haven't looked at the recent changes to the include mechanism) refactoring git_deploy so it gracefully handles that case?
Comment #7
moshe weitzman commenteddrush already has the git binary at its fingertips. I have no desire to funnel calls through a library like glip.
i just added a --skip option in devel so folks can skip the auto-download of its firephp library. we could do same here to address @Freso who doesn't want the Glip as a git clone. see http://drupalcode.org/project/devel.git/commitdiff/4cc5fa29b4ef4b450cd14...
Comment #8
rfayIt looks to me like this clones into sites/all/modules/git_deploy/glib, whereas the instructions say to put it into sites/all/libraries?
With it in sites/all/modules/glip, you can't use submodules correctly because you have a repo inside a child repo.
Comment #9
halstead commentedI like to have glip in sites/all/libraries and use the libraries module so that other code can take advantage of glip as well. If you have the libraries module installed then glip will go into sites/all/libraries and the problem will be avoided.
Would the --skip option mentioned in #7 fix the problem when the libraries module isn't present?
Comment #10
lsiden commentedNot sure whether this is related or should be a new issue: When I ran drush pm-enable git_deploy it barfed:
Executing: git clone https://github.com/halstead/glip.git && cd glip && git checkout 1.0
error: SSL certificate problem, verify that the CA cert is OK. Details:
error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed while accessing https://github.com/halstead/glip.git/info/refs
fatal: HTTP request failed
I had to change "http://" to "git://" in git_deploy.drush.inc.
Patch file attached as "git_deploy.diff".
If this is not the appropriate thread, then please refer and or let me know and I will create new issue.
Comment #11
moshe weitzman commentedThis code can make drush_git_deploy_post_pm_enable() a bit more robust about detecting devel during a multiple extension enable.
Comment #12
moshe weitzman commentedActually, this is more robust as it is not dependant on drush version
Comment #14
halstead commentedI don't think this will ever be backported to 6.x. I'm closing this issue.