Skip to content

Commit

Permalink
Merge pull request #1063 from nextcloud-releases/master
Browse files Browse the repository at this point in the history
  • Loading branch information
Altahrim authored May 29, 2024
2 parents 03da6a0 + 4f39fd9 commit e83cbb6
Show file tree
Hide file tree
Showing 6 changed files with 81 additions and 23 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
config/config.php: config/major_versions.json config/releases.json $(wildcard config/enterprise_releases.json)
config/config.php: config/major_versions.json config/releases.json $(wildcard config/enterprise_*.json)
@echo '🏗 Build configuration file $(@)…'
build/config_builder > $(@)

Expand Down
15 changes: 11 additions & 4 deletions build/config_builder
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,14 @@ $majorVersions = loadJson('major_versions');
$releases = loadJson('releases');

try {
$enterpriseReleases = loadJson('enterprise');
$enterpriseMajorVersions = loadJson('enterprise_major_versions');
$enterpriseReleases = loadJson('enterprise_releases');
foreach($majorVersions as $name => $version) {
if (isset($enterpriseMajorVersions[$name])) {
$majorVersions[$name] = array_merge($version, $enterpriseMajorVersions[$name]);
}
}
$majorVersions = array_replace_recursive($majorVersions + $enterpriseMajorVersions);
$releases = array_merge($releases, $enterpriseReleases);
$latestReleases = $generatedConfig = ['enterprise' => [], 'stable' => [], 'beta' => []];
} catch (\Exception) {
Expand All @@ -32,16 +39,15 @@ foreach ($releases as $releaseName => $info) {
}

// Generate previous configuration
$now = date('Y-m');
foreach ($releases as $releaseName => $info) {
preg_match('/(\d+)\.(\d+).(\d+)(?: (.+))?/A', $releaseName, $matches);
[, $major, $minor, $patch] = $matches;
$stability = getStabilityFromName($releaseName);
$isEol = isset($majorVersions[$major]['eol']) ? ($majorVersions[$major]['eol'] < $now) : false;
$isEol = isEol($releaseName, $majorVersions[$major]);
$generatedConfig[$stability][$major]['100'] = [
'latest' => $releaseName,
'internalVersion' => $info['internalVersion'],
'downloadUrl' => buildDownloadUrl($releaseName, $info),
'downloadUrl' => buildDownloadUrl($releaseName, $info, $majorVersions[$major]),
'web' => sprintf($docUrl, $major),
'eol' => $isEol,
'minPHPVersion' => $majorVersions[$major]['minPHP'] ?? '',
Expand Down Expand Up @@ -75,6 +81,7 @@ foreach($generatedConfig as $stability => $ignored) {

// Daily updates
$maxMajor = (int) max(array_keys($majorVersions));
$now = date('Y-m');
foreach ($majorVersions as $majorVersion => $info) {
if ($majorVersion < 20) {
break;
Expand Down
19 changes: 17 additions & 2 deletions build/utils.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,9 @@ function displayAsFile(array $generatedConfig) {
echo ';',PHP_EOL;
}

function buildDownloadUrl(string $releaseName, array $info): string {
function buildDownloadUrl(string $releaseName, array $info, array $majorVersion): string {
if (function_exists('buildEnterpriseDownloadUrl')) {
$url = buildEnterpriseDownloadUrl($releaseName, $info);
$url = buildEnterpriseDownloadUrl($releaseName, $info, $majorVersion);
if ($url !== null) {
return $url;
}
Expand All @@ -77,3 +77,18 @@ function buildDownloadUrl(string $releaseName, array $info): string {
$release['modifier'] === '' ? '' : str_replace(' ', '', strtolower($release['modifier'])),
);
}

function isEol(string $releaseName, array $majorVersion): bool {
if (function_exists('isEnterpriseEol')) {
$isEol = isEnterpriseEol($releaseName, $majorVersion);
if ($isEol !== null) {
return $isEol;
}
}

if (!isset($majorVersion['eol'])) {
return false;
}

return $majorVersion['eol'] < date('Y-m');
}
32 changes: 32 additions & 0 deletions config/config.php
Original file line number Diff line number Diff line change
Expand Up @@ -644,6 +644,38 @@
],
],
'beta' => [
29 => [
100 => [
'latest' => '29.0.2 RC2',
'internalVersion' => '29.0.2.1',
'downloadUrl' => 'https://download.nextcloud.com/server/prereleases/nextcloud-29.0.2rc2.zip',
'web' => 'https://docs.nextcloud.com/server/29/admin_manual/maintenance/upgrade.html',
'eol' => false,
'minPHPVersion' => '8.0',
'signature' => 'p4lyqDXbOlM2IFcr6pxyIgH/h2MNXueG4NTnRoKwQf7Yk4+VekooQxd0Uy83gH11
vUYVSSCSzQqN0NTXZrdLJFQzjHTq6ZQG229RG2YNfV7g5GLK16vs4bc+98aRgy51
20K/yxvVwXI8M62DJv6/+a35KvzPLaSo3Khymk1D5QoJ487y21fsBXzm/aAHL4hy
/tXb8+WOIdIbz1H5fhEaS3lWYCZpIt74zZimnVIvv6IlowE4f3Yr+0QcghGtyUU/
DhCcXiUTM2+5mkP6jN2vm2P7/r3KiTbU02WpYF1wyjQkvzv4l+70MdbXbfBXpy4Q
wcsIWI/7wuu4dPICbCPsIg==',
],
],
'28.0.6.1' => [
100 => [
'latest' => '29.0.2 RC2',
'internalVersion' => '29.0.2.1',
'downloadUrl' => 'https://download.nextcloud.com/server/prereleases/nextcloud-29.0.2rc2.zip',
'web' => 'https://docs.nextcloud.com/server/29/admin_manual/maintenance/upgrade.html',
'eol' => false,
'minPHPVersion' => '8.0',
'signature' => 'p4lyqDXbOlM2IFcr6pxyIgH/h2MNXueG4NTnRoKwQf7Yk4+VekooQxd0Uy83gH11
vUYVSSCSzQqN0NTXZrdLJFQzjHTq6ZQG229RG2YNfV7g5GLK16vs4bc+98aRgy51
20K/yxvVwXI8M62DJv6/+a35KvzPLaSo3Khymk1D5QoJ487y21fsBXzm/aAHL4hy
/tXb8+WOIdIbz1H5fhEaS3lWYCZpIt74zZimnVIvv6IlowE4f3Yr+0QcghGtyUU/
DhCcXiUTM2+5mkP6jN2vm2P7/r3KiTbU02WpYF1wyjQkvzv4l+70MdbXbfBXpy4Q
wcsIWI/7wuu4dPICbCPsIg==',
],
],
'27.1.10.1' => [
100 => [
'latest' => '28.0.6',
Expand Down
4 changes: 4 additions & 0 deletions config/releases.json
Original file line number Diff line number Diff line change
Expand Up @@ -88,5 +88,9 @@
"29.0.1": {
"internalVersion": "29.0.1.1",
"signature": "MV1tA/Qtn5SUMSOPiu9c1N3PEL09AO7PKduaQGYXlWIRA+qJcJfq6YtN4W0QvSDaKo/j4KcpAM0w8b3O+qOJOFApDo3vHVH3mqNLnyL6+SYKTob2Kclnnx9Fke1tozviki29GZmbff8KNPuSSYOt2HTY73bh0Esit73+jIufsOciMNyAtOd47TtkAKfK/fNIDbGT9YJn0gi3ulQ9zfMRFhK+yP4S5WQY43RFPp8qzjA44pgLn2IMu9HmH0Mz36ddmyRG4PG3IaLxfIF3O3/xhvEpqz0BSrJRAIptAZ9YdQZjt+bkh1DoW0HtkN+4FVp40DAbpdTSYEu6OUzAFq8I1g=="
},
"29.0.2 RC2": {
"internalVersion": "29.0.2.1",
"signature": "p4lyqDXbOlM2IFcr6pxyIgH/h2MNXueG4NTnRoKwQf7Yk4+VekooQxd0Uy83gH11vUYVSSCSzQqN0NTXZrdLJFQzjHTq6ZQG229RG2YNfV7g5GLK16vs4bc+98aRgy5120K/yxvVwXI8M62DJv6/+a35KvzPLaSo3Khymk1D5QoJ487y21fsBXzm/aAHL4hy/tXb8+WOIdIbz1H5fhEaS3lWYCZpIt74zZimnVIvv6IlowE4f3Yr+0QcghGtyUU/DhCcXiUTM2+5mkP6jN2vm2P7/r3KiTbU02WpYF1wyjQkvzv4l+70MdbXbfBXpy4QwcsIWI/7wuu4dPICbCPsIg=="
}
}
32 changes: 16 additions & 16 deletions tests/integration/features/beta.feature
Original file line number Diff line number Diff line change
Expand Up @@ -513,18 +513,18 @@ Feature: Testing the update scenario of beta releases
And the installation mtime is "11"
When The request is sent
Then The response is non-empty
And Update to version "29.0.1.1" is available
And URL to download is "https://download.nextcloud.com/server/releases/nextcloud-29.0.1.zip"
And Update to version "29.0.2.1" is available
And URL to download is "https://download.nextcloud.com/server/prereleases/nextcloud-29.0.2rc2.zip"
And URL to documentation is "https://docs.nextcloud.com/server/29/admin_manual/maintenance/upgrade.html"
And EOL is set to "0"
And The signature is
"""
MV1tA/Qtn5SUMSOPiu9c1N3PEL09AO7PKduaQGYXlWIRA+qJcJfq6YtN4W0QvSDa
Ko/j4KcpAM0w8b3O+qOJOFApDo3vHVH3mqNLnyL6+SYKTob2Kclnnx9Fke1tozvi
ki29GZmbff8KNPuSSYOt2HTY73bh0Esit73+jIufsOciMNyAtOd47TtkAKfK/fNI
DbGT9YJn0gi3ulQ9zfMRFhK+yP4S5WQY43RFPp8qzjA44pgLn2IMu9HmH0Mz36dd
myRG4PG3IaLxfIF3O3/xhvEpqz0BSrJRAIptAZ9YdQZjt+bkh1DoW0HtkN+4FVp4
0DAbpdTSYEu6OUzAFq8I1g==
p4lyqDXbOlM2IFcr6pxyIgH/h2MNXueG4NTnRoKwQf7Yk4+VekooQxd0Uy83gH11
vUYVSSCSzQqN0NTXZrdLJFQzjHTq6ZQG229RG2YNfV7g5GLK16vs4bc+98aRgy51
20K/yxvVwXI8M62DJv6/+a35KvzPLaSo3Khymk1D5QoJ487y21fsBXzm/aAHL4hy
/tXb8+WOIdIbz1H5fhEaS3lWYCZpIt74zZimnVIvv6IlowE4f3Yr+0QcghGtyUU/
DhCcXiUTM2+5mkP6jN2vm2P7/r3KiTbU02WpYF1wyjQkvzv4l+70MdbXbfBXpy4Q
wcsIWI/7wuu4dPICbCPsIg==
"""

Scenario: Updating Nextcloud 29 on the beta channel
Expand All @@ -534,16 +534,16 @@ Feature: Testing the update scenario of beta releases
And the installation mtime is "11"
When The request is sent
Then The response is non-empty
And Update to version "29.0.1.1" is available
And URL to download is "https://download.nextcloud.com/server/releases/nextcloud-29.0.1.zip"
And Update to version "29.0.2.1" is available
And URL to download is "https://download.nextcloud.com/server/prereleases/nextcloud-29.0.2rc2.zip"
And URL to documentation is "https://docs.nextcloud.com/server/29/admin_manual/maintenance/upgrade.html"
And EOL is set to "0"
And The signature is
"""
MV1tA/Qtn5SUMSOPiu9c1N3PEL09AO7PKduaQGYXlWIRA+qJcJfq6YtN4W0QvSDa
Ko/j4KcpAM0w8b3O+qOJOFApDo3vHVH3mqNLnyL6+SYKTob2Kclnnx9Fke1tozvi
ki29GZmbff8KNPuSSYOt2HTY73bh0Esit73+jIufsOciMNyAtOd47TtkAKfK/fNI
DbGT9YJn0gi3ulQ9zfMRFhK+yP4S5WQY43RFPp8qzjA44pgLn2IMu9HmH0Mz36dd
myRG4PG3IaLxfIF3O3/xhvEpqz0BSrJRAIptAZ9YdQZjt+bkh1DoW0HtkN+4FVp4
0DAbpdTSYEu6OUzAFq8I1g==
p4lyqDXbOlM2IFcr6pxyIgH/h2MNXueG4NTnRoKwQf7Yk4+VekooQxd0Uy83gH11
vUYVSSCSzQqN0NTXZrdLJFQzjHTq6ZQG229RG2YNfV7g5GLK16vs4bc+98aRgy51
20K/yxvVwXI8M62DJv6/+a35KvzPLaSo3Khymk1D5QoJ487y21fsBXzm/aAHL4hy
/tXb8+WOIdIbz1H5fhEaS3lWYCZpIt74zZimnVIvv6IlowE4f3Yr+0QcghGtyUU/
DhCcXiUTM2+5mkP6jN2vm2P7/r3KiTbU02WpYF1wyjQkvzv4l+70MdbXbfBXpy4Q
wcsIWI/7wuu4dPICbCPsIg==
"""

0 comments on commit e83cbb6

Please sign in to comment.