Skip to content

Disable platform.php composer config for lowest/latest jobs #79

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -88,14 +88,19 @@ function composer_install_dependencies {
COMPOSER_ARGS="${COMPOSER_ARGS} --ignore-platform-req=php"
fi


case $DEPS in
lowest)
echo "Installing lowest supported dependencies via Composer"
# Disable platform.php, if set
composer config --unset platform.php
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fancy, didn't know of this shortcut!

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@rdohms taught me to avoid manually updating composer.json whenever possible, and the config subcommand is our friend here. :)

Better, it doesn't emit an error if the setting isn't present, which ensures the script continues running in those cases.

# shellcheck disable=SC2086
composer update ${COMPOSER_ARGS} --prefer-lowest
;;
latest)
echo "Installing latest supported dependencies via Composer"
# Disable platform.php, if set
composer config --unset platform.php
# shellcheck disable=SC2086
composer update ${COMPOSER_ARGS}
;;
Expand Down