edbizarro / gitlab-ci-pipeline-php

:coffee: Docker images for test PHP applications with Gitlab CI (or any other CI platform!)
https://hub.docker.com/r/edbizarro/gitlab-ci-pipeline-php
MIT License
528 stars 166 forks source link

Composer 2 #106

Open j3j5 opened 3 years ago

j3j5 commented 3 years ago

Now that Composer 2 has been released I was wondering what you think is the best approach to make it available on the image. Not sure if it makes sense to have both versions available for a while or if it'd be better to include version 2 directly since they are mostly compatible. An advantage is that we can remove prestissimo from the dependencies, for the rest, I've been testing it on the image and there's nothing else that seems to be causing issues.

I guess there will be people for which there may be some incompatibilities but if they've been using an up-to-date version of this image they probably have been getting warnings about it for a while.

What do you think? I can help create the PR with whatever approach you think is best.

Cheers!

romainnorberg commented 3 years ago

Hello @j3j5

Temporarily, on an existing project, we are testing the following solution:

project:
  services:
    - mariadb:10.3
  image: edbizarro/gitlab-ci-pipeline-php:7.4-alpine
  script:
    - composer -V # Composer version 1.10.15 2020-10-13 15:59:09
    - sudo composer self-update --2 
    - composer -V 
    # The "hirak/prestissimo" plugin (installed globally) was skipped because it requires a Plugin API version ("^1.0.0") that does not match your Composer installation ("2.0.0"). You may need to run composer update with the "--no-plugins" option. 
    # Composer version 2.0.3 2020-10-28 15:50:55

I think it would be good to be able to switch from V1 to V2 and vice-versa.

j3j5 commented 3 years ago

Hi @romainnorberg , that exactly has been my approach, to upgrade from the container, but I guess it'd be better if we could choose w/o having to download the upgrade/downgrade every time. Personally, I'd go for using composer2 only and leave the downgrade (as you mention above) as an option, but I guess it's @edbizarro call.

j3j5 commented 3 years ago

I see there's an open PR #108, I'm fine with that approach :+1:

rsereir commented 3 years ago

@j3j5 I confirm you before doing my PR, I saw the message from @romainnorberg and i use this to solve my CI

C0kkie commented 3 years ago

@edbizarro Possible that composer 2 is still not working?

almightynassar commented 3 years ago

Is there anything that is being done about this?

Is there a better alternative?