feat: готовый бренд ZoomStage и минимальный доменный подвал (refs #12)
deploy-preland / deploy zoomstage.online (push) Successful in 44s

This commit is contained in:
Panfilov Konstantin committed 2026-10-21 17:24:14 +03:00
1 parent a2c3197a16
commit ec087ea636
24 files changed
+365 -237

No files matched your search

+16 -2
View File
@@ -2,6 +2,9 @@
/** preland#11: старый бренд запрещён независимо от обновления manifest. */
declare(strict_types=1);
$root = dirname(__DIR__);
require_once $root . '/components/asset-url.php';
$assetsUriPrefix = 'https://zoomzilla.ru';
if (!str_starts_with(prelandAssetUrl('docs/logo.svg'), '/docs/logo.svg?v=')) throw new RuntimeException('Доменный логотип не должен браться с общего assets/API хоста');
$oldBlob = '91267982e1ad373b6ebd5fb2b761b34fe2a0c2a5';
foreach (['docs/logo.svg', 'docs/logo-alt.svg'] as $file) {
$body = str_replace("\r\n", "\n", file_get_contents($root . '/' . $file));
@@ -13,11 +16,11 @@ foreach (['docs/logo.svg', 'docs/logo-alt.svg'] as $file) {
require $root . '/bin/release-assets.php';
validateReleaseAssets($root);
$files = releaseFiles($root);
foreach (['docs/logo.svg', 'docs/logo-alt.svg', 'docs/privacy_policy.pdf', 'template.php'] as $file) {
foreach (['docs/privacy_policy.pdf', 'template.php'] as $file) {
if (!in_array($file, $files, true)) throw new RuntimeException('Не включён ' . $file);
}
foreach ($files as $file) {
if (preg_match('~^(tests/|bin/|release/|docs/superpowers/|config\.json$|[0-9]+/)~', $file)) {
if (preg_match('~^(tests/|bin/|release/|docs/superpowers/|config\.json$|[0-9]+/|docs/logo(?:-alt)?\.svg$)~', $file)) {
throw new RuntimeException('В кодовую поставку попал защищённый/служебный файл ' . $file);
}
}
@@ -32,6 +35,17 @@ $copy = static function (string $relative) use ($root, $fixture): void {
$manifest = json_decode(file_get_contents($root . '/release/assets.json'), true, 512, JSON_THROW_ON_ERROR);
foreach (array_keys($manifest['files']) as $file) $copy($file);
$copy('release/assets.json');
$copy('release/brands.json');
$brands = json_decode(file_get_contents($root . '/release/brands.json'), true, 512, JSON_THROW_ON_ERROR);
foreach ($brands as $brand) foreach ($brand['logos'] as $record) $copy($record['file']);
$brand = prelandBrand($root, 'zoomstage.online');
$new = array_map(static fn(array $record): string => $record['sha256'], $brand['logos']);
$old = $brand['replace_from'];
foreach ([[$old, 10], [$new, 0], [['docs/logo.svg' => $new['docs/logo.svg'], 'docs/logo-alt.svg' => $old['docs/logo-alt.svg']], 10], [['docs/logo.svg' => $old['docs/logo.svg'], 'docs/logo-alt.svg' => $new['docs/logo-alt.svg']], 10], [['docs/logo.svg' => 'unknown', 'docs/logo-alt.svg' => $new['docs/logo-alt.svg']], 1]] as [$actual, $state]) {
if (prelandBrandState($actual, $brand) !== $state) throw new RuntimeException('Миграция бренда не восстанавливается после частичного put');
}
try { prelandBrand($root, 'unregistered.example'); throw new LogicException('Неизвестная цель принята'); }
catch (RuntimeException $expected) {}
try {
validateReleaseAssets($fixture);
$mustFail = static function (callable $mutate) use ($fixture): void {