Skip to content

Idea: Dynamic deploy configurations #11

@eimermusic

Description

@eimermusic

Hi @nickfan
I had an idea... not fully baked and ready for any PR.

Like the question in #7 , I too want to separate staging and production deploys in a more dynamic way than a symlink. I would, for example, want to default to a "safe" deploy target. Let me know if any of the below would be interesting to make a bit nicer and pull back into the project.

Here is where I am so far:
I am modifying the @include line at the top of Envoy.blade.php to allow for a variable filename.

@include('envoy.'.env('CONFIG', 'config').'.php');

I can then call envoy and prepend a temporary env variable called CONFIG.

CONFIG=production envoy run deploy

This gets me a default running of the default config file and allows for additional files to be chosen using this env var. I am not super happy about the resulting filenames. But I preferred to retain compatibility with the default filename without complicating the change. envoy.production.php is not a great filename but I can live with it.

I initially wanted an Envoy argument to specify the config file or "deploy type". E.G:

envoy run deploy --config=production

I did not get that working. I guess that Envoy is not fully bootstrapped at the time of this include, which is done by Blade.

I also thought about possibly doing it in the config file. E.g. including additional files if the variable is found... this could be interesting in allowing part of the config to be global and other parts to be specific to the deployment type.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions