Skip to content
This repository has been archived by the owner on Feb 13, 2023. It is now read-only.

Use of Composer (instead of Drush Make) for building Drupal site #506

Closed
jasloe opened this issue Mar 7, 2016 · 25 comments
Closed

Use of Composer (instead of Drush Make) for building Drupal site #506

jasloe opened this issue Mar 7, 2016 · 25 comments

Comments

@jasloe
Copy link

jasloe commented Mar 7, 2016

Just getting started with Drupal 8 and seeing that quite a few folks are using Composer to build. Any plans to include Composer support as a build option, instead of make?

@geerlingguy
Copy link
Owner

I would like to do this soon, yes; just waiting for things to standardize a little more. I know there is a more-or-less 'official' workflow now (see below references), but there is still differing opinions on best practices for some of the sticky bits, like versioning, patches, extra libraries (non-PHP), etc. so I'm not sure if this will be a feature by Drupal VM 3.0.0 or not.

References:

The full workflow is currently supported, but not automated by, Drupal VM.

@geerlingguy geerlingguy changed the title composer support? Allow use of Composer (instead of Drush Make) for building Drupal site Mar 7, 2016
@geerlingguy geerlingguy changed the title Allow use of Composer (instead of Drush Make) for building Drupal site Use of Composer (instead of Drush Make) for building Drupal site Mar 7, 2016
@geerlingguy
Copy link
Owner

This is also something that I'm considering using as an excuse to switch things to my geerlingguy.drupal role instead of custom playbooks inside Drupal VM.

@ghost
Copy link

ghost commented Mar 8, 2016

I noticed this drupal.org issue for direct Composer support that might be worth following:

https://www.drupal.org/node/2551607

@jasloe
Copy link
Author

jasloe commented Mar 8, 2016

Good news, Jeff. Thanks for such a great resource. Slightly off-topic: wondering whether the addition of Drupal Console is also something worth exploring in the context of this project?

@geerlingguy
Copy link
Owner

@minorscience - Drupal Console has been part of Drupal VM for some time :) — just make sure it's uncommented in installed_extras.

@oxyc
Copy link
Collaborator

oxyc commented Mar 8, 2016

@geerlingguy but then it's only a documentation issue right? Would be cool to get the building blocks in for a 3.0.0 release as I assume switching to geerlingguy.drupal would require quite a few breaking changes. Docs for best practice could be added or tuned later in my opinion. I'd like to give composer a shot too as we've made the switch on all of our non-Drupal projects already :)

Edit: or are you considering using composer as the default instead of drush make?

@thom8
Copy link
Collaborator

thom8 commented Mar 9, 2016

👍 for geerlingguy.drupal - would be good to collaborate if possible.

We're looking to push this role to galaxy when stable, which currently supports composer installations.

@geerlingguy
Copy link
Owner

I'm considering composer as the default, and drush make as an alternative option. It's definitely going to be the future of Drupal 8 site building, and the main/only reason to keep it around is for D7 projects, imo.

@geerlingguy geerlingguy added this to the 3.0.0 milestone Mar 21, 2016
@frob
Copy link
Contributor

frob commented Mar 30, 2016

+1 to this. Just started finding drupal projects that drush cannot install correctly.

@heddn
Copy link
Contributor

heddn commented Apr 1, 2016

https://github.com/MTechLLC/d8_starter is composer driven base d8 starter site that has ideas to consider.

@geerlingguy geerlingguy modified the milestones: drupalcon, 3.0.0 Apr 4, 2016
@fubarhouse
Copy link

@geerlingguy drupal console has been fixed for some time - it's used again in the provisioning of the systems I look after, so feel free to throw it out there again!

@heddn
Copy link
Contributor

heddn commented Apr 22, 2016

I've been using a 100% composer driven workflow with drupalvm for the past 3 weeks. I don't know that anything needs to change in the project. Some of the workflow to run a drush make need to be disabled. And a post provision script to run composer install + drush si config_install (I'm using config installer module to install from config stored on the filesystem on up from the webroot.)

@geerlingguy
Copy link
Owner

@heddn - For Drupal VM's purposes, the main change would be to use a composer.json file instead of the Drush make file to build the baked-in Drupal 8 site. But you're correct, the full workflow is already supported if you're doing a manual/self-scripted site installation.

@oxyc
Copy link
Collaborator

oxyc commented Jun 2, 2016

@geerlingguy are you thinking about bringing in geerlingguy.drupal for this task or simply switching build_makefile: false and adding composer.json as the default?

@geerlingguy
Copy link
Owner

@oxyc - Long term I'd like to use geerlingguy.drupal... but that's a heftier project, since I'm trying to do a comprehensive rewrite of that role to make it work for all my production deploys/updates/etc.

So if it's quicker, I'm happy to just changeover things in Drupal VM to support a fully-composer-based-workflow.

@geerlingguy
Copy link
Owner

Especially if you want to tackle it, and earn yet another free beer if I ever get to meet you :D

@oxyc
Copy link
Collaborator

oxyc commented Jun 2, 2016

Hold off on 3.1.0 a bit and I'll try to get a PR for tomorrow hopefully. With BLT and d8 in mind it would be nice to default to a composer based install instead.

I've scheduled 2018 for traveling around the US so I'll stop by for a few beers then :D

@thom8
Copy link
Collaborator

thom8 commented Jun 3, 2016

@oxyc -- here's a starting point -- https://github.com/beetboxvm/beetbox/blob/master/provisioning/ansible/roles/beetbox-drupal/tasks/build-composer.yml

but +1 for a galaxy role that we could share.

@geerlingguy
Copy link
Owner

@thom8 - That's the end goal, but initial goal I think will be to just keep spreading adoption of composer.json for Drupal 8 site builds. I'm finally using it for a large project now, and besides a few growing pains, it's great!

@thom8
Copy link
Collaborator

thom8 commented Jun 3, 2016

Drupal 9 might only be a composer.json file 😉

@geerlingguy
Copy link
Owner

@thom8 - That would be awesome—by that time, I hope our greatest hurdle to adoption will be overcoming the Mars-->Earth latency in composer-based dependency downloads.

@oxyc
Copy link
Collaborator

oxyc commented Jun 3, 2016

@geerlingguy what do you think about using drupal-composer/drupal-project as another default option?

Would be nice if it worked like:

  • If build_makefile is set to true, install with makefile.
  • If build_composer and a composer.json exists (as with BLT), install from there.
  • Otherwise with build_composer, install drupal-project.

Might be a bit tricky due to the docroot path being different between drupal-project and makefiles. I'll play around a bit.

Other option is to provide an example.composer.json that people need to copy and rename as they do with makefiles at the moment. That's a bit of a maintenance burden though.

@mchelen
Copy link
Contributor

mchelen commented Jun 3, 2016

+1 for drupal-composer/drupal-project because it's the cleanest way I've found to manage a drupal codebase with composer

@geerlingguy
Copy link
Owner

Either way may be workable... I haven't tried drupal-project itself before, just composer.json.

geerlingguy added a commit that referenced this issue Jun 5, 2016
Issue #506: Add support for composer based site builds
@geerlingguy
Copy link
Owner

All right, the main supporting code has been merged, and I've opened up a follow-up issue to discuss defaulting to Composer at some point in the future: #699

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

8 participants