mirror of
https://github.com/opdavies/build-configs.git
synced 2025-09-05 19:05:33 +01:00
Add remaining templates
This commit is contained in:
parent
014b6dabeb
commit
579c476a54
8 changed files with 198 additions and 5 deletions
|
@ -28,16 +28,27 @@ final class BuildConfigurationCommand extends Command
|
|||
parent::__construct();
|
||||
}
|
||||
|
||||
public function execute(InputInterface $input, OutputInterface $output)
|
||||
public function execute(InputInterface $input, OutputInterface $output): int
|
||||
{
|
||||
$io = new SymfonyStyle($input, $output);
|
||||
|
||||
$buildYaml = Yaml::parseFile(getcwd().'/build.yaml');
|
||||
$configurationData = Yaml::parseFile(getcwd().'/build.yaml');
|
||||
$configurationData['dockerCompose'] = $configurationData['docker-compose'];
|
||||
$configurationData['docker-compose'] = null;
|
||||
|
||||
$io->info("Building configuration for {$buildYaml['name']}.");
|
||||
$io->info("Building configuration for {$configurationData['name']}.");
|
||||
|
||||
if ($buildYaml['language'] === self::LANGUAGE_PHP) {
|
||||
$this->filesystem->dumpFile('Dockerfile', $this->twig->render('php/Dockerfile.twig', $buildYaml));
|
||||
$this->filesystem->dumpFile('.env.example', $this->twig->render('env.example.twig', $configurationData));
|
||||
$this->filesystem->dumpFile('Dockerfile', $this->twig->render('Dockerfile.twig', $configurationData));
|
||||
|
||||
if ($configurationData['dockerCompose'] === true) {
|
||||
$this->filesystem->dumpFile('docker-compose.yaml', $this->twig->render('docker-compose.yaml.twig', $configurationData));
|
||||
}
|
||||
|
||||
if ($configurationData['language'] === self::LANGUAGE_PHP) {
|
||||
$this->filesystem->dumpFile('phpcs.xml.dist', $this->twig->render('phpcs.xml.twig', $configurationData));
|
||||
$this->filesystem->dumpFile('phpstan.neon.dist', $this->twig->render('phpstan.neon.twig', $configurationData));
|
||||
$this->filesystem->dumpFile('phpunit.xml.dist', $this->twig->render('phpunit.xml.twig', $configurationData));
|
||||
}
|
||||
|
||||
return Command::SUCCESS;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue