Hello,
I'm currently working on integrating Drupal with Gerrit & Jenkins.
I have already something working, you can see screenshots here: http://storify.com/drupol/gerrit-jenkins-aegir-and-drupal
I'm planning to make the full documentation when I have something working at 100%.
In a few words, when you push a commit into Gerrit, Jenkins is able to trigger a new build and test your patch.
If jenkins got a successful build, he can reports back to Gerrit, and like that, for each commit/push.
For that you need Drush to download a particular changeset (refspec in git).
Currently, Drush (download) is not able to download particular refspec.
My patch allows you to specify a new attribute to the download: the refspec.
Example:
projects[myprofile][type] = "profile"
projects[myprofile][download][type] = "git"
projects[myprofile][download][url] = git://gitserver/myprofile
projects[myprofile][download][refspec] = 'refs/changes/28/28/1'
The changes in the code are pretty simple, I test if the $download['refspec']
is not empty, and if so, I run two commands: git fetch and git checkout.
Also, if there is a refspec, it will have priority over other parameters such as branch, tag or revision.
Patch will follow.
Comments
Comment #1
PolPatch for 6.x-2.x
Comment #2
moshe weitzman CreditAttribution: moshe weitzman commentedLooks like a useful patch. But we need patches against Drush5 which is where make lives now. It is no longer a separate project.
Comment #3
PolHere it is for drush (master branch)
Comment #4
moshe weitzman CreditAttribution: moshe weitzman commentedLooks good, but needs a new test to be part of an existing test
Comment #5
jhedstromIn addition to a test, it would be nice to update the README (in
commands/make
) to reflect this new functionality.Comment #6
PolVoila, changes are made.
- Updated the README.
- Updated the makefile, so tests are done.
Comment #7
PolComment #8
PolUpdated md5 in the testMake.php.
Thanks for the heads up @moshe weitzman !
Comment #9
PolAdded more documentation in EXAMPLE.make.
Added a
make_error()
if we cannot fetch the refspec.Comment #10
moshe weitzman CreditAttribution: moshe weitzman commentedI think the drush_log() for FETCH_HEAD should be for $type='info' so it does not show except for --verbose and higher. no need to change that unless you reroll for some other reason. otherwise, looks good.
Comment #11
Polrerolled to change
$type = 'info'
.Comment #12
moshe weitzman CreditAttribution: moshe weitzman commentedcommitted
Comment #13
dwwPretty sure this broke the intent of #1371298: Rewrite .info files inside drush make when checking out from git to include version and project info and #1302820: Inject version info into .info file in git_drupalorg engine for tracking through *default* update report -- nothing in this patch does anything about .info file rewriting, but all that code depends on version, branch or tag being specified. That said, I'm not sure exactly what we *can* do for the .info file rewriting if you have a refspec like 'refs/changes/28/28/1'...
Comment #14
jhedstrom@dww does it only break if a refspec is specified, or does this code break previously functional .info file rewriting?
Comment #15
dwwI just mean that if a refspec is specified, none of the .info file re-writing logic (at least as I wrote it) is going to work. So, I don't think this breaks any existing code. But, if you define a refspec, we're going to fail to re-write your .info files.