[Travis] Created the local dependency directory on host for Composer command to pass #648
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
We have builds failing with errors like:
Link: https://travis-ci.com/github/ezsystems/ezplatform-admin-ui/builds/218066131
Root cause:
The issue is caused by these lines: https://github.com/ezsystems/ezplatform/blob/master/bin/.travis/trusty/setup_ezplatform.sh#L56-L80
We move the directory containg tested package to another location:
Code:
Output:
And then try to configure Composer to use that dependency:
Please note the comment:
local checkout path relative to docker volume
. We've moved the dependency to/home/travis/build/ezplatform/ezplatform-workflow
, but tell Composer to look for it in/var/www/${BASE_PACKAGE_NAME}
.Our Docker containers have the following volumes specified: https://github.com/ezsystems/ezplatform/blob/master/doc/docker/base-dev.yml#L8 (and
${COMPOSE_DIR}
evaluates to/home/travis/build/ezplatform/
, meaning that/home/travis/build/ezplatform/ezplatform-workflow
from host is mapped to/var/www/ezplatform-workflow
inside Docker container.But the next lines:
So far, we have set Composer up to use a repository which does not exist on host (this is what the error message is saying to us:
), it exists only in Docker container.
But the
composer require --no-update "${DEPENDENCY_PACKAGE_NAME}:dev-${TMP_TRAVIS_BRANCH} as ${BRANCH_ALIAS}
is not invoked in the container, it is run on the host.Before Composer 2.0.10 it did not make a difference - most likely because
--no-update
is used Composer did not care that one of the repositories points to a non-existant directory.On Composer 2.0.10 the behaviour changed - Composer validates the repositories and complains that one of them has invalid configuration.
Solutions I've considered:
https://github.com/ezsystems/ezplatform/blob/master/doc/docker/install_script.sh , which start from
composer install
. We would have to remake that script somehow to pass the dependency to require before it's called, which IMHO is not worth it - the script is no longer used for 3.3, the approach is changed for Flex setup.Also changed the repository type -
path
is the correct one when Composer should use local dependencies:https://getcomposer.org/doc/05-repositories.md#path
Companion PR to test the solution:
ezsystems/ezplatform-admin-ui#1712