-
Notifications
You must be signed in to change notification settings - Fork 6
Description
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.