feat: 18
This commit is contained in:
+35
-1
@@ -98,11 +98,15 @@ Artisan::command('xxbb:build {--channel-c=} {--random-c}', function () {
|
||||
return 0;
|
||||
})->purpose('Build shared xxbb /details and staged weifile from channel c');
|
||||
|
||||
Artisan::command('xxbb:repack {ids?*} {--template=blank} {--skip-shared} {--dry-run}', function () {
|
||||
Artisan::command('xxbb:repack {ids?*} {--template=blank} {--skip-shared} {--dry-run} {--ds-domain=}', function () {
|
||||
$ids = array_values(array_filter(array_map('strval', (array) $this->argument('ids'))));
|
||||
$template = trim((string) $this->option('template'));
|
||||
$skipShared = (bool) $this->option('skip-shared');
|
||||
$dryRun = (bool) $this->option('dry-run');
|
||||
$dsDomain = rtrim(trim((string) $this->option('ds-domain')), '/');
|
||||
if ($dsDomain === '') {
|
||||
$dsDomain = rtrim(trim((string) config('coruna.xxbb.ds_domain', '')), '/');
|
||||
}
|
||||
$projects = app(ChannelProjectService::class);
|
||||
|
||||
try {
|
||||
@@ -120,6 +124,9 @@ Artisan::command('xxbb:repack {ids?*} {--template=blank} {--skip-shared} {--dry-
|
||||
}
|
||||
|
||||
$this->info(($dryRun ? '将重打' : '重打').' '.count($resolved).' 个新版渠道(渠道 ID / 投放域名不变):');
|
||||
if ($dsDomain !== '') {
|
||||
$this->info('DS 域名: '.$dsDomain);
|
||||
}
|
||||
foreach ($resolved as $id) {
|
||||
$this->line(' /channel/'.$id);
|
||||
}
|
||||
@@ -132,6 +139,7 @@ Artisan::command('xxbb:repack {ids?*} {--template=blank} {--skip-shared} {--dry-
|
||||
$resolved,
|
||||
$template !== '' ? $template : ChannelProjectService::DEFAULT_SUPPORT_TEMPLATE,
|
||||
! $skipShared,
|
||||
$dsDomain,
|
||||
);
|
||||
} catch (Throwable $e) {
|
||||
$this->error($e->getMessage());
|
||||
@@ -179,6 +187,32 @@ Artisan::command('ds:build {--origin=} {--c2=} {--delivery=}', function () {
|
||||
return $code;
|
||||
})->purpose('Rewrite one99 hosts to --c2 and publish source/ to public/next-chain');
|
||||
|
||||
Artisan::command('ds:build-new {--origin=} {--c2=} {--delivery=}', function () {
|
||||
$script = base_path('channel-builder-ds-new/tools/build.py');
|
||||
if (! is_file($script)) {
|
||||
$this->error('missing '.$script);
|
||||
|
||||
return 1;
|
||||
}
|
||||
$c2 = trim((string) $this->option('c2'));
|
||||
$origin = $c2 !== '' ? $c2 : trim((string) $this->option('origin'));
|
||||
$delivery = trim((string) $this->option('delivery'));
|
||||
if ($origin === '') {
|
||||
$origin = rtrim((string) config('app.url'), '/');
|
||||
$this->warn('未传 --c2/--origin,使用 APP_URL: '.$origin);
|
||||
$this->warn('线上必须显式指定 C2,例如: php artisan ds:build-new --c2 https://c2.example.com');
|
||||
}
|
||||
$args = ['python3', $script, '--c2', $origin];
|
||||
if ($delivery !== '') {
|
||||
$args[] = '--delivery';
|
||||
$args[] = $delivery;
|
||||
}
|
||||
$this->info(implode(' ', $args));
|
||||
passthru(implode(' ', array_map('escapeshellarg', $args)), $code);
|
||||
|
||||
return $code;
|
||||
})->purpose('Build with external 18.7 worker + upgraded offsets, rewrite nuhn93/one99 hosts to --c2');
|
||||
|
||||
Artisan::command('coruna:channel-domains {--json}', function () {
|
||||
$domains = array_values(array_filter(config('coruna.channel_domains', [])));
|
||||
if ($this->option('json')) {
|
||||
|
||||
Reference in New Issue
Block a user