Skip to content

Commit 76584e6

Browse files
committed
Update schema
1 parent 07ce07a commit 76584e6

2 files changed

Lines changed: 271 additions & 130 deletions

File tree

bin/docgen

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ namespace Deployer;
1010

1111
use Deployer\Documentation\ApiGen;
1212
use Deployer\Documentation\DocGen;
13+
use Deployer\Import\MamlRecipe;
14+
use Maml\Maml;
1315
use Symfony\Component\Console\Application;
1416
use Symfony\Component\Console\Input\ArgvInput;
1517
use Symfony\Component\Console\Output\ConsoleOutput;
@@ -47,11 +49,23 @@ $recipes = function () use ($input, $output): int {
4749
return 0;
4850
};
4951

52+
$schema = function () use ($output): int {
53+
$newSchema = [
54+
'$id' => "https://deployer.org/schema.json#",
55+
...Maml::jsonSchema(MamlRecipe::schema()),
56+
];
57+
file_put_contents(__DIR__ . '/../src/schema.json', json_encode($newSchema, JSON_PRETTY_PRINT));
58+
$output->writeln('Schema updated.');
59+
return 0;
60+
};
61+
5062
$app->register('api')->setCode($api);
5163
$app->register('recipes')->setCode($recipes)->addOption('json');
52-
$app->register('all')->setCode(function () use ($recipes, $api): int {
64+
$app->register('schema')->setCode($schema);
65+
$app->register('all')->setCode(function () use ($schema, $recipes, $api): int {
5366
$api();
5467
$recipes();
68+
$schema();
5569
echo shell_exec('git status');
5670
return 0;
5771
})->addOption('json');

0 commit comments

Comments
 (0)