Commit 0c3008e8 authored by Hendrik Heneke's avatar Hendrik Heneke
Browse files

Switched back to standalone application and renamed package.

parent 604bc534
Pipeline #367 passed with stage
in 18 seconds
<?php
declare(strict_types=1);
namespace HHIT\ConfigGeneratorBundle\Generator\Validator;
namespace HHIT\ConfigGenerator\Generator\Validator;
class ValidatorFactory
{
......
<?php
declare(strict_types=1);
namespace HHIT\ConfigGeneratorBundle\Generator\Validator;
namespace HHIT\ConfigGenerator\Generator\Validator;
interface ValidatorInterface
{
......
<?php
declare(strict_types=1);
namespace HHIT\ConfigGeneratorBundle\Generator\Validator;
namespace HHIT\ConfigGenerator\Generator\Validator;
use Symfony\Component\Yaml\Exception\ParseException;
use Symfony\Component\Yaml\Yaml;
......
<?php
declare(strict_types=1);
namespace HHIT\ConfigGeneratorBundle\Generator\Values;
namespace HHIT\ConfigGenerator\Generator\Values;
use HHIT\ConfigGeneratorBundle\Generator\IO\File;
use HHIT\ConfigGeneratorBundle\Generator\IO\JsonReader;
use HHIT\ConfigGeneratorBundle\Generator\Secrets\SecretProviderInterface;
use HHIT\ConfigGenerator\Generator\IO\File;
use HHIT\ConfigGenerator\Generator\IO\JsonReader;
use HHIT\ConfigGenerator\Generator\Secrets\SecretProviderInterface;
class ValuesLoader extends JsonReader
{
......
<?php
declare(strict_types=1);
namespace HHIT\ConfigGeneratorBundle\Generator\Values;
namespace HHIT\ConfigGenerator\Generator\Values;
use HHIT\ConfigGeneratorBundle\Generator\IO\File;
use HHIT\ConfigGeneratorBundle\Generator\Secrets\SecretProviderFactory;
use HHIT\ConfigGenerator\Generator\IO\File;
use HHIT\ConfigGenerator\Generator\Secrets\SecretProviderFactory;
class ValuesLoaderFactory
{
......
<?php
declare(strict_types=1);
namespace HHIT\ConfigGeneratorBundle\Kernel;
use HHIT\ConfigGeneratorBundle\ConfigGeneratorBundle;
use Symfony\Bundle\FrameworkBundle\FrameworkBundle;
use Symfony\Component\Config\Loader\LoaderInterface;
use Symfony\Component\HttpKernel\Kernel as BaseKernel;
class StandaloneKernel extends BaseKernel
{
public function registerBundles()
{
return [
new FrameworkBundle(),
new ConfigGeneratorBundle()
];
}
public function registerContainerConfiguration(LoaderInterface $loader)
{
}
}
services:
_defaults:
autowire: true
autoconfigure: true
HHIT\ConfigGeneratorBundle\Generator\Definition\DefinitionReader:
public: true
arguments:
$projectDir: '%kernel.project_dir%'
HHIT\ConfigGeneratorBundle\Generator\Secrets\SymfonyVaultSecretProvider:
public: true
arguments:
$sodiumVault: '@secrets.vault'
$dotenvVault: '@secrets.local_vault'
HHIT\ConfigGeneratorBundle\Generator\Secrets\SecretProviderFactory:
public: true
arguments:
$symfonyProvider: '@HHIT\ConfigGeneratorBundle\Generator\Secrets\SymfonyVaultSecretProvider'
HHIT\ConfigGeneratorBundle\Generator\Values\ValuesLoaderFactory:
public: true
arguments:
$secretProviderFactory: '@HHIT\ConfigGeneratorBundle\Generator\Secrets\SecretProviderFactory'
HHIT\ConfigGeneratorBundle\Generator\Validator\ValidatorFactory:
public: true
HHIT\ConfigGeneratorBundle\Generator\Generator:
public: true
arguments:
$definitionReader: '@HHIT\ConfigGeneratorBundle\Generator\Definition\DefinitionReader'
$valuesLoaderFactory: '@HHIT\ConfigGeneratorBundle\Generator\Values\ValuesLoaderFactory'
$validatorFactory: '@HHIT\ConfigGeneratorBundle\Generator\Validator\ValidatorFactory'
HHIT\ConfigGeneratorBundle\Command\GenerateConfigsCommand:
public: true
tags:
- { name: 'console.command', command: 'cfgen:generate-configs' }
arguments:
$generator: '@HHIT\ConfigGeneratorBundle\Generator\Generator'
<?php
declare(strict_types=1);
namespace HHIT\ConfigGeneratorBundle\Tests;
use HHIT\ConfigGeneratorBundle\Command\GenerateConfigsCommand;
use HHIT\ConfigGeneratorBundle\Generator\Definition\DefinitionReader;
use HHIT\ConfigGeneratorBundle\Generator\IO\ReaderFactory;
use HHIT\ConfigGeneratorBundle\Generator\Generator;
use HHIT\ConfigGeneratorBundle\Generator\Secrets\SecretProviderFactory;
use HHIT\ConfigGeneratorBundle\Generator\Secrets\SymfonyVaultSecretProvider;
use HHIT\ConfigGeneratorBundle\Generator\Validator\ValidatorFactory;
use HHIT\ConfigGeneratorBundle\Generator\Values\ValuesLoaderFactory;
use Symfony\Bundle\FrameworkBundle\Test\KernelTestCase;
class ConfigGeneratorBundleTest extends KernelTestCase
{
/**
* @before
*/
public static function before()
{
self::bootKernel();
}
function dependencies()
{
return [
'definition-reader' => [DefinitionReader::class],
'symfony-vault-secret-provider' => [SymfonyVaultSecretProvider::class],
'secret-provider-factory' => [SecretProviderFactory::class],
'values-loader-factory' => [ValuesLoaderFactory::class],
'validator-factory' => [ValidatorFactory::class],
'processor' => [Generator::class],
'generate-configs-command' => [GenerateConfigsCommand::class]
];
}
/**
* @test
* @dataProvider dependencies
*/
function dependencyConfigured($id)
{
$this->assertNotNull(self::$container->get($id));
}
}
{
"users.json": {
"template": "./templates/users.json.hbs",
"type": "json",
"values": "./values/users.values.json",
"destination": "var/users.json"
},
"users.yaml": {
"template": "./templates/users.yaml.hbs",
"type": "yaml",
"values": "./values/users.values.json",
"destination": "var/users.yaml"
}
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment