chore(ci): отключить production и legacy автодеплой (refs #4)
This commit is contained in:
1 parent
029cd16d46
commit
8274946610
4 files changed
+70
-276
No files matched your search
@@ -36,30 +36,20 @@ if (!is_array($config)) {
|
||||
}
|
||||
|
||||
$workflow = (string) file_get_contents($root . '/.gitea/workflows/deploy.yml');
|
||||
$legacyStart = strpos($workflow, ' deploy:');
|
||||
$stageStart = strpos($workflow, 'deploy-zoomstage:');
|
||||
$productionStart = strpos($workflow, 'deploy-zoompixel-production:');
|
||||
$legacyBlock = $legacyStart === false || $stageStart === false
|
||||
? ''
|
||||
: substr($workflow, $legacyStart, $stageStart - $legacyStart);
|
||||
$stageBlock = $stageStart === false || $productionStart === false
|
||||
? ''
|
||||
: substr($workflow, $stageStart, $productionStart - $stageStart);
|
||||
$productionBlock = $productionStart === false ? '' : substr($workflow, $productionStart);
|
||||
|
||||
foreach ([
|
||||
'legacy FTP' => $legacyBlock,
|
||||
'deploy-zoomstage' => $stageBlock,
|
||||
'deploy-zoompixel-production' => $productionBlock,
|
||||
] as $delivery => $block) {
|
||||
if ($block === ''
|
||||
|| !str_contains($block, 'config\\.json$')
|
||||
|| !str_contains($block, 'ensure-focus-config.php')
|
||||
|| !str_contains($block, 'Preserve host config and add focus if absent')) {
|
||||
$failures[] = "{$delivery} обязан сохранять хостовый config.json и менять только явно согласованный focus.";
|
||||
}
|
||||
$stageStart = strpos($workflow, ' deploy-zoomstage:');
|
||||
$stageBlock = $stageStart === false ? '' : substr($workflow, $stageStart);
|
||||
if ($stageBlock === '' || !str_contains($stageBlock, 'config\\.json$')
|
||||
|| !str_contains($stageBlock, 'ensure-focus-config.php')
|
||||
|| !str_contains($stageBlock, 'Preserve host config and add focus if absent')) {
|
||||
$failures[] = 'Stage обязан сохранять хостовый config.json и согласованный focus-контракт.';
|
||||
}
|
||||
if (preg_match_all('/^ [a-z][a-z0-9-]*:/m', substr($workflow, strpos($workflow, 'jobs:')), $jobs) !== 1
|
||||
|| !str_contains($workflow, " - staging")
|
||||
|| str_contains($workflow, " - main")
|
||||
|| str_contains($workflow, 'deploy-zoompixel-production:')
|
||||
|| str_contains($workflow, 'barbariskatest')) {
|
||||
$failures[] = 'По решению владельца автодеплой должен содержать только staging/zoomstage.online.';
|
||||
}
|
||||
|
||||
if (is_file($root . '/config.json.example')) {
|
||||
$failures[] = 'config.json.example не должен существовать: рабочий config.json единственный.';
|
||||
}
|
||||
@@ -69,4 +59,4 @@ if ($failures !== []) {
|
||||
exit(1);
|
||||
}
|
||||
|
||||
fwrite(STDOUT, "OK: versioned stage config and ZoomPixel delivery\n");
|
||||
fwrite(STDOUT, "OK: host config preserved; deploy targets stage only\n");
|
||||
Reference in new issue
Block a user