Error in CircleCi Integration on symfony app

141 Views Asked by At

Problem :

Hello everyone, I have an error in integrating circli on my symfony project. It can't build because there is a problem between composer.lock and composer.json

Project structure:

-root directory

--.circleci

--app

--landing

config.yml :


# PHP CircleCI 2.0 configuration file
#
# Check https://circleci.com/docs/2.0/language-php/ for more details
#
version: 2.1
orbs:
  codecov: codecov/[email protected]
  browser-tools: circleci/[email protected]
jobs:
  build:
    docker:
      - image: cimg/php:8.1.12-browsers
        environment:
          APP_ENV: test
          MYSQL_ALLOW_EMPTY_PASSWORD: yes
          WITH_XDEBUG: 1
      - image: mysql:5.7
        environment:
          APP_ENV: test
          MYSQL_ALLOW_EMPTY_PASSWORD: yes
    working_directory: ~/rootDir/app
    resource_class: medium
    steps:
      - run:
          name: Print environment variables
          command: printenv
      - run:
          name: Check PHP version
          command: php -v
      - run:
          name: Install System Packages
          command: sudo apt-get update && sudo apt-get --fix-missing -y install git unzip zlib1g-dev libxslt-dev libpng-dev
      - run:
          name: Install PHP Extensions
          command: sudo apt-get -y install php-gd php-xml php-zip php-curl php-mbstring php-mysql php-intl php8.1-intl php8.1-mbstring php-imap php8.1-imap php-xsl php8.1-xsl php-xdebug php8.1-xdebug
      - run:
          name: Install more PHP extensions
          command: |
            sudo -E install-php-extensions xsl
            sudo docker-php-ext-enable xsl
      - run:
          name: Check PHP config
          command: php -m
      - run:
          name: Check PHP version
          command: php -v
      - run:
          name: Locate php ini
          command: php --ini
      - run:
          name: Current directory
          command: pwd
      - checkout
      - run:
          name: Setting permissions
          command: sudo chmod -R 777 *
      - run:
          name: Composer self-update
          command: cd /home/circleci/rootDir/app && sudo composer self-update --2
      - run:
          name: Composer version
          command: cd /home/circleci/rootDir/app && composer --version
      - run:
          name: List files on app
          command: cd /home/circleci/rootDir/app/app && ls -alt
      - run:
          name: List composer.lock content
          command: cd /home/circleci/rootDir/app/app && cat composer.lock
      #      - run:
      #          name: Disable xdebug
      #          command: |
      #            sudo sed -i 's/^zend_extension/;zend_extension/g' /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini
      # Dependencies

 

      - run: cd /home/circleci/rootDir/app/app && composer install --prefer-dist --no-interaction
      # Force pulling Simple PHPUnit dependencies to be able to cache them as well
      - run:
          name: Check PHPUnit version
          command: cd /home/circleci/rootDir/app/app && sudo ./bin/phpunit --version
      - save_cache:
          key: cfp-{{ .Branch }}-{{ checksum "/home/circleci/rootDir/app/app/composer.lock" }}-v1
          paths:
            - "/root/.composer/cache"
            - "./vendor"
      - run:
          name: Install Yarn
          command: cd /home/circleci/rootDir/app/app && yarn install
      - run:
          name: Yarn build
          command: cd /home/circleci/rootDir/app/app && yarn build
      # Database
      - run:
          name: Create database
          command: cd /home/circleci/rootDir/app/app && sudo ./bin/console doctrine:database:create --no-interaction --env=test
      - run:
          name: Create database schema
          command: cd /home/circleci/rootDir/app/app && sudo ./bin/console doctrine:schema:create --no-interaction --env=test
      - run:
          name: Update database schema
          command: cd /home/circleci/rootDir/app/app && sudo ./bin/console doctrine:schema:update --force --env=test --no-interaction
      #      - run:
      #          name: Install fixtures
      #          command: sudo ./bin/console hautelook:fixtures:load --no-interaction --env=test

 

      # Testing
      - run:
          name: Test yaml syntax
          command: cd /home/circleci/rootDir/app/app && sudo ./bin/console lint:yaml config
      - run:
          name: Run tests suite
          command: |
            cd /home/circleci/rootDir/app/app
            mkdir -p ~/phpunit
            sudo XDEBUG_MODE=coverage ./bin/phpunit --verbose -d memory_limit=-1 --coverage-clover ~/phpunit/coverage.xml --log-junit ~/phpunit/junit.xml tests
          when: always
      - store_test_results:
          path: ~/phpunit
      - store_artifacts:
          path: ~/phpunit
      - codecov/upload:
          file: ~/phpunit/coverage.xml

Error:

Error on this line "cd /home/circleci/rootDir/app/app && composer install --prefer-dist --no-interaction"

Warning: Module "xsl" is already loaded in Unknown on line 0 Installing dependencies from lock file (including require-dev) Verifying lock file contents can be installed on current platform. Your lock file does not contain a compatible set of packages. Please run composer update.

Problem 1 - php-imap/php-imap is locked to version 5.0.1 and an update of this package was not requested. - php-imap/php-imap 5.0.1 requires ext-imap * -> it is missing from your system. Install or enable PHP's imap extension. Problem 2 - php-imap/php-imap 5.0.1 requires ext-imap * -> it is missing from your system. Install or enable PHP's imap extension. - secit-pl/imap-bundle 2.0.0 requires php-imap/php-imap ~4.4|~5.0 -> satisfiable by php-imap/php-imap[5.0.1]. - secit-pl/imap-bundle is locked to version 2.0.0 and an update of this package was not requested.

To enable extensions, verify that they are enabled in your .ini files: - /etc/php.d/circleci.ini You can also run php --ini in a terminal to see which files are used by PHP in CLI mode. Alternatively, you can run Composer with --ignore-platform-req=ext-imap to temporarily ignore these required extensions.

Exited with code exit status 2

CircleCI received exit code 2

Thank you for reading

0

There are 0 best solutions below