Skip to content

Support using a config file for input rather than a python script #223

Description

@al-jeyapal

It'd be a lot less boilerplate if for simple stacks, we just allowed a config file (e.g. appcli.yaml) in the resources dir which defines the values we pass to the Configuration block:

        configuration = Configuration(
            app_name='myapp',
            docker_image='brightsparklabs/myapp',
            seed_app_configuration_file=Path(BASE_DIR, 'resources/settings.yml'),
            stack_configuration_file=Path(BASE_DIR, 'resources/stack-settings.yml'),
            baseline_templates_dir=Path(BASE_DIR, 'resources/templates/baseline'),
            configurable_templates_dir=Path(BASE_DIR, 'resource/templates/configurable'),
            orchestrator=DockerComposeOrchestrator(
                docker_compose_file = Path('docker-compose.yml'),
                docker_compose_override_directory = Path('docker-compose.override.d/'),
                docker_compose_task_file = Path('docker-compose.tasks.yml'),
                docker_compose_task_override_directory = Path(
                    'docker-compose.tasks.override.d/'
                ),
            ),
            mandatory_additional_data_dirs=['EXTRA_DATA',],
            mandatory_additional_env_variables=['ENV_VAR_2',],
        )

So the idea is that if you don't want to use your own custom python file, you just drop appcli.yml in the right location in the stock appcli image, and a stock appcli.py run with basically the above. Probably don't need to support custom hooks in this scenario.

If we go this route, worth looking at the ConfZ library for managing the config file. This would allow us to use env vars to overwrite settings in the yml file, etc.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions