Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add PLUGIN_ENVIRONMENT_ID and PLUGIN_ENVIRONMENT_TYPE to Support Custom Environment Settings #24

Open
Ompragash opened this issue Sep 12, 2024 · 0 comments
Labels
enhancement New feature or request

Comments

@Ompragash
Copy link
Member

Description:

This enhancement proposes adding two new plugin configuration options: PLUGIN_ENVIRONMENT_ID and PLUGIN_ENVIRONMENT_TYPE. These settings allow users to explicitly define the ID and Type fields in the environment section of the deployment payload. If these parameters are provided, the payload will use them directly. If they are not provided, the existing logic will apply, with the environment being determined by PLUGIN_ENVIRONMENT_NAME or defaulting to “production”.

Problem:

Currently, the environment details (ID, DisplayName, Type) in the deployment payload are determined automatically based on the environment name or default values. This limits flexibility for users who need to specify custom values for Environment.ID and Environment.Type in their deployment payloads.

Solution:

Introduce two new settings, PLUGIN_ENVIRONMENT_ID and PLUGIN_ENVIRONMENT_TYPE, to allow users to explicitly pass these values. If these settings are provided, they will be used directly in the payload. Otherwise, the current behavior will be retained.

Example Payload Behavior:

  1. When All Three Parameters Are Passed:
    If PLUGIN_ENVIRONMENT_ID, PLUGIN_ENVIRONMENT_TYPE, and PLUGIN_ENVIRONMENT_NAME are passed, the environment section in the payload will use these values directly:
- name: deployment
  image: your-plugin-image
  settings:
    environment_id: "env-12345"
    environment_type: "staging"
    environment_name: "custom-environment"

The payload will then contain:

Environment: Environment{
    ID:          "env-12345",
    Displayname: "custom-environment",
    Type:        "staging",
}
  1. When Only PLUGIN_ENVIRONMENT_NAME Is Passed (Current Behaviour):
    If only PLUGIN_ENVIRONMENT_NAME is passed, the old logic will apply, and the environment values will be automatically determined:
- name: deployment
  image: your-plugin-image
  settings:
    environment_name: "production"

The payload will then contain:

Environment: Environment{
    ID:          "production",
    Displayname: "production",
    Type:        "production",
}
@Ompragash Ompragash added the enhancement New feature or request label Sep 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant