Hello,
I use CircleCI to build (with docker) a test environement to run my symfony 3.4 application.
The last successful build was 27 days ago. I deployed a new feature yesterday but the composer install step is failing for no reason (the message is not very explicit).
This the error message:
This step used to run without trouble.
Here is the config.yml:
# PHP CircleCI 2.0 configuration file
#
# Check https://circleci.com/docs/2.0/language-php/ for more details
#
version: 2
jobs:
build:
# docker:
#- image: circleci/php:7.1-cli-jessie-node-browsers-legacy
machine: true
working_directory: ~/repo
steps:
- checkout
- run: mkdir ~/repo/features/fail-screenshots
- run: cp .circleci/.env.dist .env
- run: cp .circleci/parameters.yml.dist app/config/parameters.yml
- run: docker-compose up -d
# Download and cache dependencies
- restore_cache:
keys:
- v1-dependencies-{{ checksum "composer.json" }}
# fallback to using the latest cache if no exact match is found
- v1-dependencies-
- run: docker-compose exec --user 1001:1002 php composer install -n --prefer-dist
- save_cache:
paths:
- ./vendor
key: v1-dependencies-{{ checksum "composer.json" }}
- run: docker-compose run --rm front yarn install
- run: docker-compose run --rm front yarn build
# run tests!
# Circleci uses a user with id 1001 and a group with id 1002
# We use this user instead of the default one in our dockerfile (1000)
# to avoid permissions issues
- run: docker-compose exec --user=1001:1002 php vendor/bin/phpspec run -vvv
# We use the root user here to change logs and cache permissions
- run: docker-compose exec --user=root php chmod -R 777 var/logs
- run: docker-compose exec --user=root php chmod -R 777 var/cache
- run: docker-compose exec php console doctrine:database:drop --if-exists --force --env=test
- run: docker-compose exec php console doctrine:database:cre --env=test
- run: docker-compose exec php console doc:sch:cre --env=test
- run: docker-compose exec php console doctrine:fixtures:load --env=test -n
# Here we use 1001:1002 to launch behat cause it can create screenshots
# so it needs to write in a directory owned by 1001:1002 (circleci user)
- run: docker-compose exec --user 1001:1002 php ./vendor/bin/behat -v
# This line is to be able to access failing screenshots in the
# artifacts section in CircleCI
- store_artifacts:
path: ~/repo/features/fail-screenshots
- store_artifacts:
path: ~/repo/features/spooled-emails
The PHP docker file:
FROM php:7.1-fpm-alpine
RUN apk --no-cache add \
mariadb-client \
icu-dev
RUN docker-php-ext-configure intl
RUN docker-php-ext-install \
intl \
pdo \
pdo_mysql
RUN docker-php-ext-enable intl
RUN echo "date.timezone=\"Europe/Paris\"" >> /usr/local/etc/php/conf.d/timezone.ini
RUN mkdir -p /usr/share/www/project && adduser -D -u 1000 user
RUN php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');" \
&& php composer-setup.php \
&& php -r "unlink('composer-setup.php');" \
&& mv composer.phar /usr/bin/composer
USER user
RUN composer global require hirak/prestissimo
RUN composer global require friendsofphp/php-cs-fixer
WORKDIR /usr/share/www/project
ENV PATH "$PATH:vendor/bin:bin:$HOME/.composer/vendor/bin"