7

I am using Drush make files to automate my site development.

I have followed this tutorial to create a Make File via Drush.

Everything works fine, except when I run the make file, Drush says it can't find the Development versions of modules (for the modules where I have used the Dev version).

According to this tutorial, this is because you have to specify the Git Address and Revision ID of the module. How do you do that?

Steps I have taken

For example, lets say I want to include 7.x-1.x-dev release of the Fences module. This dev module was released on 2013-Sep-30.

On the project page, there is an option called View all Releases. However, on this page, none of the releases are dated 2013-Sep-30. The project page also has links to a Git page for the project. However, this doesn't seem to have been updated for a while as the newest update was 15 months ago.

How do I find the Git address for this Dev module or is there another way of including it in my make file?

17
+50

You're almost there - what you need to add to your make file looks like this and you have to specify the git url and commit identifier.

projects[path_breadcrumbs][version] = "3.x-dev"
projects[path_breadcrumbs][download][type] = "git"
projects[path_breadcrumbs][download][url] = "http://git.drupal.org/project/path_breadcrumbs.git"
projects[path_breadcrumbs][download][revision] = "c9c570b0b4bde1df0e5a322ab90197d7fc1cf9c6"

To find this, go to the project page on drupal.org and select 'view commits', ex enter image description here

On the next page, select the one you are interested in that reflects the state of the module you want to add to your make file. For this example, I'm going to grab the last commit:

enter image description here

and I'm clicking the 'commit bdcf88a' link which takes me to:

http://drupalcode.org/project/path_breadcrumbs.git/commit/bdccf8a

Now I know that the the [download][url] is:

http://drupalcode.org/project/path_breadcrumbs.git

and the full hash for the commit I am looking for is:

bdccf8a901b6d2359b6da195d23cadf7dd90c4ec

--

Further updates as requested -- if you're looking for a specific dev branch you may want to switch to the command line to do a --recursive clone to make sure you're getting all the branches. Following this question:

How do I git pull a dev branch?

I'm going to do a recursive pull of the git 7.x-1.x branch

git clone --recursive --branch 7.x-1.x http://git.drupal.org/project/fences.git

Now I can see what branches are available:

git branch -r
  origin/1343724-region
  origin/7.x-1.x
  origin/HEAD -> origin/master
  origin/master

Now I can checkout this branch for 7.x-1.x and check the log, which will give me the last commit and the one that was used to generate the development snapshot.

git checkout 7.x-1.x
git log

  commit 67206b5220cbebf52e8e6a290ccb977b2420b2ad
  Author: JohnAlbin <virtually.johnalbin@gmail.com>
  Date:   Tue Sep 4 13:44:40 2012 +0800

      Fix code comments on figcaption.

The date is different from what you may see on the project home page only because this is an automatic development snapshot created by the Drupal.org git bots but the development snapshot is always created from the branch with the same version number and the '-dev' part is never used in the branch name.

  • Thanks so much, but does this apply to all modules. For example, on Fences, the latest dev version is 2013-Sep-30 but when I click on View Commits, the latest release is dated September 4, 2012, which is ~1 year earlier. What can I do in situations like this? Thanks for any help you can offer. – big_smile Dec 12 '13 at 7:52
  • 1
    If you don't specify the commit/revision you'll just get the latest dev version all the time. – benjy Dec 13 '13 at 22:12
  • @ben, How would you declare it in the make file. When i use the Drush make command and then run it drush it says that it can't find it, so I guess it must have to be declared in a special way in the make file? Thanks for any help! – big_smile Dec 14 '13 at 10:10
  • @schnippy Thanks for posting this awesome guide. I've followed it very carefully, but can't get it to work. Here is what I have put in my make file: projects[fences][version] = "1.0+6-dev" projects[fences][download][type] = "git" projects[fences][download][url] = "http://drupalcode.org/project/fences.git" projects[fences][download][revision] = "67206b5220cbebf52e8e6a290ccb977b2420b2ad" It seems correct, but I can't get it to work? Thanks for any help you can offer. – big_smile Dec 14 '13 at 14:52
  • 1
    @big_smile here's an example. gist.github.com/benjy14/7941404 – benjy Dec 14 '13 at 22:02
2

The current version of Drush only requires the branch name and the commit hash of the version of the module, since Drush Make now uses git by default and can find the path to the git repo.

projects[myproject][download][branch] = 7.x-1.x
projects[myproject][download][revision] = abcd123
1

schnippy's answer is correct, and should be accepted. The instructions above do apply to all modules. The only confusion remaining is the date 2013-Sep-30, which I believe is an artifact of the Drupal.org upgrade to Drupal 7. In any event, all that date is telling you is that drupal.org packaged a release on that date. The latest commit (2012-Sep-30) represents the very latest code available for that module. Even if some release is packaged and labeled with a later date, it won't have any newer code in it -- there is no newer code than the last commit.

0

IMHO it's much better download D.O. releases instead of GIT branches.

If you have declared the core version (the most usual) this line forces download the 2.x dev branch of fboauth module:

projects[fboauth][version] = 2.x-dev
  • The problem with this approach is that it doesn't pin you to a specific dev version. So if the maintainers make a bunch of commits to that branch, the next time you run drush make it will download the new changes, which may break your site. – Brian Aug 24 '16 at 22:46
  • Maybe, but you should specify the major version so the API should've no changes. – Alvaro J Hurtado Villegas Aug 25 '16 at 19:07

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.