Skip to content

Commit

Permalink
Update dev build config to use Composer 2 and PHP 7.4
Browse files Browse the repository at this point in the history
  • Loading branch information
pjcdawkins committed Nov 22, 2024
1 parent 0842554 commit 83698bf
Show file tree
Hide file tree
Showing 7 changed files with 1,474 additions and 1,876 deletions.
15 changes: 12 additions & 3 deletions .platform.app.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
name: app
type: php:7.3
disk: 128
type: php:7.4

dependencies:
php:
composer/composer: "^2"

hooks:
build: |
Expand All @@ -9,7 +12,13 @@ hooks:
export version=dev-"$PLATFORM_TREE_ID"
composer bin all install
composer install -a --no-dev --no-interaction
composer install -d vendor-bin/box --no-interaction
mkdir -p vendor/bin
ln -s "$(realpath vendor-bin/box/vendor/bin/box)" vendor/bin/box
./bin/platform self:build --no-composer-rebuild --yes --replace-version "$version" --output web/platform.phar
cat << EOF > .environment
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM php:7.3-cli
FROM php:7.4-cli

ARG USER_ID
ARG GROUP_ID
Expand Down
6 changes: 1 addition & 5 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,7 @@
},
"require-dev": {
"phpunit/phpunit": "^4.3 !=4.8.0",
"drush/drush": "^8.0",
"bamarni/composer-bin-plugin": "^1.2"
"drush/drush": "^8.0"
},
"authors": [
{
Expand All @@ -60,9 +59,6 @@
"config": {
"platform": {
"php": "5.5.9"
},
"allow-plugins": {
"bamarni/composer-bin-plugin": true
}
},
"scripts": {
Expand Down
52 changes: 1 addition & 51 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion scripts/test/build-and-install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ if [ ! -d vendor ]; then
composer install
fi
if [ ! -d vendor-bin/box/vendor ]; then
composer bin all install
composer -d vendor-bin/box install
fi

function cleanup {
Expand Down
11 changes: 4 additions & 7 deletions src/Command/Self/SelfBuildCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -99,28 +99,25 @@ protected function execute(InputInterface $input, OutputInterface $output)
// Wipe the vendor directory to be extra sure.
$shell->execute(['rm', '-rf', 'vendor'], CLI_ROOT, false);

// We cannot use --no-dev, as that would exclude the
// composer-bin-plugin tool.
$shell->execute([
'composer',
'install',
'--classmap-authoritative',
'--no-interaction',
'--no-progress',
'--no-dev',
], CLI_ROOT, true, false);

// Install composer-bin-plugin dependencies.
// Install Box.
$shell->execute([
'composer',
'bin',
'all',
'install',
'--no-interaction',
'--no-progress',
], CLI_ROOT, true, false);
], CLI_ROOT . DIRECTORY_SEPARATOR . 'vendor-bin' . DIRECTORY_SEPARATOR . 'box', true, false);
}

$boxArgs = [CLI_ROOT . '/vendor/bin/box', 'compile', '--no-interaction'];
$boxArgs = [CLI_ROOT . '/vendor-bin/box/vendor/bin/box', 'compile', '--no-interaction'];
if ($output->isVeryVerbose()) {
$boxArgs[] = '-vvv';
} elseif ($output->isVerbose()) {
Expand Down
Loading

0 comments on commit 83698bf

Please sign in to comment.