Skip to content

Commit 907ce3c

Browse files
committed
qa: re-order composer installation and default PHP version handling
The current PHP default version was determine from the `composer.json` **after** `composer install` was called. With `composer install` (prior setting default PHP version) that will be the last installed PHP version via `apt`. This reorder should actually ensure that we do not accidentally have a newer version used to install composer dependencies. Signed-off-by: Maximilian Bösing <[email protected]>
1 parent 0ccb38f commit 907ce3c

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

Dockerfile

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -271,22 +271,22 @@ COPY composer.json \
271271
composer.lock \
272272
/tools/
273273

274-
RUN cd /tools \
275-
# Install `ext-bcmath` as it seems to be a requirement for `roave/backward-compatibility-check`
276-
&& apt install -y php-bcmath \
277-
&& composer install \
278-
--classmap-authoritative
279-
280274
# Set default PHP version based on the `composer.json` `config.platform.php` setting
281275
RUN export DEFAULT_PHP_VERSION=$(jq -r '.config.platform.php | sub("(?<minor>[0-9.]).99$"; "\(.minor)")' /tools/composer.json) \
282-
# Cleanup composer files from external tools folder
283-
&& rm /tools/composer.* \
284276
&& update-alternatives --set php /usr/bin/php$DEFAULT_PHP_VERSION \
285277
&& update-alternatives --set phpize /usr/bin/phpize$DEFAULT_PHP_VERSION \
286278
&& update-alternatives --set php-config /usr/bin/php-config$DEFAULT_PHP_VERSION \
287279
&& update-alternatives --set phpdbg /usr/bin/phpdbg$DEFAULT_PHP_VERSION \
288280
&& echo "DEFAULT_PHP_VERSION=${DEFAULT_PHP_VERSION}" >> /etc/environment
289281

282+
RUN cd /tools \
283+
# Install `ext-bcmath` as it seems to be a requirement for `roave/backward-compatibility-check`
284+
&& apt install -y php-bcmath \
285+
&& composer install \
286+
--classmap-authoritative \
287+
# Cleanup composer files from external tools folder
288+
&& rm /tools/composer.* \
289+
290290
# Copy staabm/annotate-pull-request-from-checkstyle to external-tools stage
291291
RUN ln -s /tools/vendor/bin/cs2pr /usr/local/bin/cs2pr
292292

0 commit comments

Comments
 (0)