1

I've been trying to set up a site on Acquia for a good 3 days now, and am baffled - Acquia doesn't allow Composer, the Acquia Dev Desktop does not sync libraries. I've tried ludwig with no luck.

Is there any way to add csv/league libraries to Acquia? W/o this capability, I'm not sure how useful Acquia is, or am I missing something simple?

  • They have CI, but for a “normal” project you’ll need to add the libraries locally, and commit the vendor folder – Clive Jun 18 at 18:31
  • 1
    You can't run these tools (Composer) in production, and you should not be running it in production. You need to build it locally, or in a free CI like GitLab CI, TravisCI or Circle CI, and deploy the result to Acquia. Acquia has Pipelines, but, I have not tried that service. Every project I have is commited to private repo in GitHub/GitLab, then a CI polls for changes and builds it, and deploys to Acquia or AWS. At a low level, you could commit the entire directory (vendor and all) to git, and push that up to Acquia if you don't want to deal with doing a build/deploy workflow. – Kevin Jun 18 at 20:52
  • 1
    I see this question a lot, I should write a post about it. It's not hard to do once you see it in action. – Kevin Jun 18 at 20:56
  • 1
    Look at BLT. It’s an Acquia command line program that allows you to work with Composer. It will build out your project from Composer.json as a read only artifact which it then deploys. – Jaypan Jun 18 at 23:45
  • Following up here with an example of how to leverage GitLab for just this purpose: kevinquillen.com/deploying-drupal-8 - note: I host projects on Acquia, but I do not use Acquia Dev Desktop or BLT or other tools. – Kevin Jun 20 at 23:02
1

Acquia has to have the full site, core, modules, themes, libraries, et.al. checked into their git repo in the format like:

git root
  docroot
    core
    modules
    themes
    etc.
    (includes index.php and other root files)

As Clive said, there is a pay for it CI process. However, for the normal sites, you need to manage the site as a whole entity. They do have Deployment hooks, but that is generally for clearing cache and the like.

FYI - I use composer on all my sites. You run it locally and check in the composer files to the repo (e.g. the composer.lock, etc.). Things like js libraries are added by manually adding repo's to the composer.json file if they are not composer friendly. E.g., here's how the jquery chosen plugin gets added:

"harvesthq.chosen": {
  "type" : "package",
  "package" : {
    "name" : "harvesthq/chosen",
    "version" : "1.8.7",
    "type" : "drupal-library",
    "dist" : {
      "url" : "https://github.com/harvesthq/chosen/releases/download/v1.8.7/chosen_v1.8.7.zip",
      "type" : "zip"
    },
    "require" : {
      "composer/installers" : "^1.2.0"
    }
  }
},

It's also best to have the Drupal friendly paths defined in your composer file. E.g.:

"extra" : {
    "installer-paths" : {
        "docroot/core" : [
            "type:drupal-core"
        ],
        "docroot/libraries/{$name}" : [
            "type:drupal-library"
        ],
        "docroot/modules/contrib/{$name}" : [
            "type:drupal-module"
        ],
        "docroot/themes/contrib/{$name}" : [
            "type:drupal-theme"
        ]

These make sure things get placed properly by composer.

-1

Acquia dev desktop comes with composer and drush installed already.

You can also install composer on your machine by following the instructions here: https://getcomposer.org/download/

There is a good tutorial here to get you set up with a Drupal 8 site package built with composer here: https://www.youtube.com/watch?v=IhWAegz8glk

The github project for that Drupal 8 composer package is here: https://github.com/drupal-composer/drupal-project

You can then open a command window in devdesktop/Sites/your-new-d8-site/Web (the root of the site you are building in dev) and then run for example composer require "drupal/commerce" This will pull in all the dependencies (and libraries) for Drupal Commerce 2 very easily without fussing with ludwig. it's very fast and easy.

Also here is a good video here on installing modules with composer: https://modulesunraveled.com/drupal-8-composer-and-configuration-management/installing-and-uninstalling-modules-composer

Hope this helps!

  • 1
    The question is really about getting it on Acquia though. Or any host. – Kevin Jun 19 at 0:34
  • I guess I focused on the general question in the title. By building the site locally via composer or in dev desktop (which already has composer) you would have the libraries in your code base and could push it to their live environment. I agree with you that someone new to composer (like myself) should NOT be running it in a production environment. – TonyTheFerg Jun 19 at 1:00
  • I see your point though. 😉 I just went through this so I know how frustrating it can be. I think I was just trying to help get it done. 😂 – TonyTheFerg Jun 19 at 1:09
  • Thanks! I'm still working on how to get Acquia Dev Desktop to sync the local site with the remote Acquia Cloud site; no matter what I do, I just can't figure out how to get everything up to the cloud. I have the local site exactly the way I want it, but am only able togget little bits to upload. I wish I could upload the whole site. – MatinicusRock Jun 19 at 19:50
  • So were you able to get libraries locally then? – TonyTheFerg Jun 20 at 2:28

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.