Skip to content

Remove implicit deployment environment #160

@tbinna

Description

@tbinna

When running the deploy executor, the executor implementation checks if the given Nx task configuration matches any of the Forge default environments ("production", "staging", or "development") and will automatically add the environment property to the Forge CLI deploy command if it does.

if (isEnvironmentName(context.configurationName)) {

This behavior is convenient but implicit and not obvious when looking at a project configuration. I suggest removing this behavior and requiring the environment property to be set on the task configuration explicitly. This also provides users the freedom to name their task configurations as they like.

Note that this will be a breaking change: Users will have to update their deploy configuration if they wish to maintain the existing behavior.

Worst case scenario: If after this change, users do not update their configurations and call the deploy task with the staging or production configuration, it will deploy to the development (Forge CLI default). This should not be too dangerous. It could apply production settings to the development environment, but this can be easily fixed by calling the deploy task again and setting the "development" configuration and environment explicitly.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions