1

I'm trying to set up pipelines on bitbucket and I'm receiving an error when composer runs

Your requirements could not be resolved to an installable set of packages.
  Problem 1
    - Installation request for craftcms/cms 3.1.24 -> satisfiable by craftcms/cms[3.1.24].
    - craftcms/cms 3.1.24 requires ext-zip * -> the requested PHP extension zip is missing from your system.

I'm not sure exactly what I need to add to my bitbucket-pipelines.yml file.

This is my current file:

image: php:7.2
pipelines:
  branches:
    master:
      - step:
          script:
            - apt-get update && apt-get install -y unzip git rsync zip 
            - curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer
            - composer install
            - php deploy.php

This guy seems to have a similar issue, but I'm not sure how he solved. It's vague and he also seems to have more output regarding mcrypt: Docker: bitbucket pipelines ext-zip *

If you're curious, I got my configuration from this suggested commit at fortrabbit.com: https://gist.github.com/ukautz/4f3219c3eb5d97fbd018027dca4b8808

The php file it's running is on the link above, but it doesn't reach that yet, so it's irrelevant to my problem

I'm not entirely sure what I have to install or if I'm just not seeing the actual problem logged (for instance if there's more granular logs somewhere and I'm not seeing the actual issue)

good_afternoon
  • 1,529
  • 1
  • 12
  • 41

2 Answers2

1

I got it working by installing libzip-dev and executing the docker-php-ext-install zip and docker-php-ext-enable zip commands.

Here is a part of my bitbucket-pipelines.yml:

  step:
    caches:
      - composer
    script:
      - apt-get update && apt-get install -y unzip libzip-dev
      - docker-php-ext-install zip
      - docker-php-ext-enable zip
      - curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer
      - composer install

Your bitbucket-pipelines.yml would look like this:

image: php:7.2
pipelines:
  branches:
    master:
      - step:
          script:
            - apt-get update && apt-get install -y unzip git rsync zip libzip-dev
            - docker-php-ext-install zip
            - docker-php-ext-enable zip
            - curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer
            - composer install
            - php deploy.php
Kevin
  • 929
  • 1
  • 8
  • 13
0

I was able to get passed this by adding the following:

zlib1g-dev after the -y flag

and then these two lines

  - docker-php-ext-install zip
  - docker-php-ext-enable zip

Before composer install

This will run the install every time though. If anyone knows a better way, please let me know

good_afternoon
  • 1,529
  • 1
  • 12
  • 41