mirror of
https://github.com/joomla-docker/docker-joomla.git
synced 2025-01-10 08:34:04 +00:00
Update update script to use new variant structure
This commit is contained in:
parent
733f34e432
commit
7d54535f6a
23
update.php
23
update.php
@ -73,9 +73,23 @@ if (!isset($signature))
|
|||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach (['apache', 'apache-php7.0', 'apache-php7.1', 'apache-php7.2', 'fpm', 'fpm-php7.0', 'fpm-php7.1', 'fpm-php7.2'] as $variant)
|
$phpVersions = [];
|
||||||
|
$platforms = ['apache', 'fpm'];
|
||||||
|
|
||||||
|
/** @var DirectoryIterator $dir */
|
||||||
|
foreach (new DirectoryIterator(__DIR__) as $dir)
|
||||||
{
|
{
|
||||||
$dockerfile = __DIR__ . "/$variant/Dockerfile";
|
if (substr($dir->getFilename(), 0, 3) === 'php')
|
||||||
|
{
|
||||||
|
$phpVersions[] = $dir->getFilename();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
foreach ($phpVersions as $phpVersion)
|
||||||
|
{
|
||||||
|
foreach ($platforms as $platform)
|
||||||
|
{
|
||||||
|
$dockerfile = __DIR__ . "/$phpVersion/$platform/Dockerfile";
|
||||||
|
|
||||||
$fileContents = file_get_contents($dockerfile);
|
$fileContents = file_get_contents($dockerfile);
|
||||||
$fileContents = preg_replace('#ENV JOOMLA_VERSION [^ ]*\n#', "ENV JOOMLA_VERSION $version\n", $fileContents);
|
$fileContents = preg_replace('#ENV JOOMLA_VERSION [^ ]*\n#', "ENV JOOMLA_VERSION $version\n", $fileContents);
|
||||||
@ -84,8 +98,9 @@ foreach (['apache', 'apache-php7.0', 'apache-php7.1', 'apache-php7.2', 'fpm', 'f
|
|||||||
file_put_contents($dockerfile, $fileContents);
|
file_put_contents($dockerfile, $fileContents);
|
||||||
|
|
||||||
// To make management easier, we use these files for all variants
|
// To make management easier, we use these files for all variants
|
||||||
copy(__DIR__ . '/docker-entrypoint.sh', __DIR__ . "/$variant/docker-entrypoint.sh");
|
copy(__DIR__ . '/docker-entrypoint.sh', __DIR__ . "/$phpVersion/$platform/docker-entrypoint.sh");
|
||||||
copy(__DIR__ . '/makedb.php', __DIR__ . "/$variant/makedb.php");
|
copy(__DIR__ . '/makedb.php', __DIR__ . "/$phpVersion/$platform/makedb.php");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
echo 'Dockerfile variants updated' . PHP_EOL;
|
echo 'Dockerfile variants updated' . PHP_EOL;
|
||||||
|
Loading…
Reference in New Issue
Block a user