Update PHP script updating used WordPress
[MAILPOET-6159]
This commit is contained in:
committed by
Rostislav Wolný
parent
5c16babf7b
commit
644a963b01
@@ -77,7 +77,7 @@ function replaceLatestWordPressVersion(string $latestVersion): void {
|
|||||||
function replacePreviousWordPressVersion(string $previousVersion): void {
|
function replacePreviousWordPressVersion(string $previousVersion): void {
|
||||||
replaceVersionInFile(
|
replaceVersionInFile(
|
||||||
__DIR__ . './../../../.circleci/config.yml',
|
__DIR__ . './../../../.circleci/config.yml',
|
||||||
'/(wordpress_image_version: )\d+\.\d+\.?\d*-php\d+\.\d+/',
|
'/(wordpress_version: )\d+\.\d+\.?\d*/',
|
||||||
'${1}' . $previousVersion
|
'${1}' . $previousVersion
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@@ -113,6 +113,8 @@ if ($latestVersion) {
|
|||||||
|
|
||||||
if ($previousVersion) {
|
if ($previousVersion) {
|
||||||
echo "Replacing the previous version in the config file...\n";
|
echo "Replacing the previous version in the config file...\n";
|
||||||
|
// We install previous WordPress version via CLI so we need a version without PHP in the name.
|
||||||
|
$previousVersion = preg_replace('/-php\d+\.\d+$/', '', $previousVersion);
|
||||||
replacePreviousWordPressVersion($previousVersion);
|
replacePreviousWordPressVersion($previousVersion);
|
||||||
} else {
|
} else {
|
||||||
echo "No previous version found.\n";
|
echo "No previous version found.\n";
|
||||||
|
Reference in New Issue
Block a user