mirror of
https://github.com/opdavies/build-configs.git
synced 2025-09-05 19:05:33 +01:00
Add initial command, get values from build.yaml
This commit is contained in:
parent
cc9a65ba96
commit
c476543f5c
4 changed files with 124 additions and 3 deletions
34
src/Console/Command/BuildConfigurationCommand.php
Normal file
34
src/Console/Command/BuildConfigurationCommand.php
Normal file
|
@ -0,0 +1,34 @@
|
|||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace OliverDaviesLtd\BuildConfiguration\Console\Command;
|
||||
|
||||
use Symfony\Component\Console\Attribute\AsCommand;
|
||||
use Symfony\Component\Console\Command\Command;
|
||||
use Symfony\Component\Console\Input\InputInterface;
|
||||
use Symfony\Component\Console\Output\OutputInterface;
|
||||
use Symfony\Component\Console\Style\SymfonyStyle;
|
||||
use Symfony\Component\Yaml\Yaml;
|
||||
|
||||
#[AsCommand(
|
||||
description: 'Build configuration files',
|
||||
name: 'build-configuration'
|
||||
)]
|
||||
final class BuildConfigurationCommand extends Command
|
||||
{
|
||||
public function execute(InputInterface $input, OutputInterface $output)
|
||||
{
|
||||
// Find a build.yaml file.
|
||||
$buildYaml = Yaml::parseFile(getcwd().'/build.yaml');
|
||||
|
||||
$io = new SymfonyStyle($input, $output);
|
||||
$io->info("Building configuration for {$buildYaml['name']}.");
|
||||
|
||||
// Parse its contents.
|
||||
// Generate the appropriate configuration files.
|
||||
//
|
||||
return Command::SUCCESS;
|
||||
}
|
||||
}
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue