Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BLT 12.x, Acquia Pipelines, and Composer 2 #4358

Closed
mikemadison13 opened this issue Mar 5, 2021 · 1 comment · Fixed by #4373
Closed

BLT 12.x, Acquia Pipelines, and Composer 2 #4358

mikemadison13 opened this issue Mar 5, 2021 · 1 comment · Fixed by #4373
Labels
Support A support request

Comments

@mikemadison13
Copy link
Contributor

Describe the bug
BLT requires Composer 2 as of 12.5. See https://docs.acquia.com/resource/using-composer/#blt. However, Acquia Pipelines does not yet support composer 2. As a result, you may see errors like:

 Problem 1
    - Installation request for acquia/blt 12.8.0 -> satisfiable by acquia/blt[12.8.0].
    - acquia/blt 12.8.0 requires composer-plugin-api ^2.0 -> no matching package found.

The solution for this is to temporarily pin your BLT installation to 12.4. https://docs.acquia.com/resource/using-composer/ provides more information on the Acquia Pipelines timeline.

@mikemadison13 mikemadison13 added the Bug Something isn't working label Mar 5, 2021
@mikemadison13
Copy link
Contributor Author

mikemadison13 commented Mar 10, 2021

I've done a basic POC over on the GovCon site to update the Pipelines script there to use Composer 2. See Drupal4Gov/Drupal-GovCon-2017#937.

A few caveats:

  • i'm manually installing composer 2 during the build and aliasing it (not actually updating the container)
  • i had to add a .gitignore rule for composer.phar before blt would complete a deployment.

TLDR add this to your pipelines script section:

- php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
- php -r "if (hash_file('sha384', 'composer-setup.php') === '756890a4488ce9024fc62c56153228907f1545c228516cbf63f885e036d37e9a59d27d63f46af1d4d07ee0f76181c7d3') { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;"
- php composer-setup.php
- php -r "unlink('composer-setup.php');"
- alias composer="php -d memory_limit=-1 /mnt/tmp/local.prod/source/composer.phar"

and throw this at the end of your project's .gitignore

composer.phar

@mikemadison13 mikemadison13 added Support A support request and removed Bug Something isn't working labels Mar 10, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Support A support request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant