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

[TTAHUB-3064] Self Service Automation - Deployed Environment: Time Slice - Phase 1: Power down lower environments during off hours #2423

Draft
wants to merge 24 commits into
base: main
Choose a base branch
from

Conversation

GarrettEHill
Copy link
Collaborator

Description of Changes

This update introduces enhancements to the CircleCI configuration, particularly around the manual_manage_env_workflow to provide more flexibility when managing application environments. Key improvements include the ability to manage specific environments dynamically through pipeline parameters, allowing for start, stop, restart, or restage operations.

Key Changes:

  1. Expanded Workflow Trigger:

    • The manual_manage_env_workflow is now configured to trigger based on the values of env_state, env_list, and space_list, enabling environment management for specific environments.
    • The workflow dynamically manages environment states such as start, stop, restart, and restage, based on the env_state parameter.
  2. Pipeline Parameters:

    • Added support for the env_state, env_list, and space_list parameters to control which environment and space are targeted, and what state change is required (e.g., start, stop).
    • Updated the workflow to pass these environment-specific parameters (env_state, env_list, and space_list) to the manage_env_apps job.
  3. Job Execution:

    • The manage_env_apps job has been updated to dynamically handle the state transition of the environment, depending on the value passed in the env_state, env_list, and space_list parameters.

Example Usage:

The following CircleCI pipeline parameters can now be used to manage specific environments:

pipeline.parameters:
  env_state: "stop"                # Specify the state (e.g., "start", "stop", "restart", "restage")
  env_list: "tta-smarthub-sandbox"  # Specify the environment (e.g., "tta-smarthub-sandbox")
  space_list: "ttahub-sandbox"      # Specify the space (e.g., "ttahub-sandbox")

With these changes, the pipeline can manage specific environments dynamically based on the values passed in env_state, env_list, and space_list, streamlining environment management for sandbox or production systems.

Benefits:

  • Greater Flexibility: The workflow is now capable of handling multiple environment states (start, stop, restart, restage) for specific environments, based on pipeline parameters.
  • Simplified Workflow Management: The new parameter-based approach allows for more dynamic and targeted environment management, reducing the need for separate workflows for each environment.
  • Dynamic Job Parameters: Parameters such as env_state, env_list, and space_list are passed dynamically, making the workflow adaptable to different environments and spaces.

How to Test

  1. Navigate to CircleCI Dashboard:

    • Go to the CircleCI website.
    • Log in and navigate to your project’s pipeline dashboard.
  2. Trigger a Pipeline Manually:

    • Select the project where the workflow is configured.
    • On the project’s dashboard, click on the "Trigger Pipeline" button (usually at the top right).
    • A dialog box will appear for you to input pipeline parameters. Input the following in the UI fields:
      • env_list: Set this to "tta-smarthub-sandbox".
      • space_list: Set this to "ttahub-sandbox".
    • Click "Trigger Pipeline" to start the workflow with the specified parameters.
  3. Monitor Workflow Execution:

    • Once the pipeline is triggered, observe the progress of the workflow on the pipeline dashboard.
    • Click into the workflow to see the specific jobs being executed (e.g., manage_env_apps).
    • Ensure the workflow starts successfully and runs the job corresponding to the environment and space you specified.
  4. View Job Logs:

    • Click on the manage_env_apps job in the workflow to see detailed logs.
    • Review the logs to verify that the job processes the environment correctly based on the values in env_list and space_list (e.g., sandbox environment actions).
    • If the job runs successfully, it will display a green checkmark. If there are issues, the logs will provide details to help troubleshoot.
  5. Test Multiple Scenarios:

    • Repeat the test by manually triggering the pipeline again, adjusting the parameters for different environments if applicable.
    • Ensure that the workflow behaves as expected based on the environment and space provided in the parameters.
  6. Ensure Expected Behavior:

    • You can run multiple tests at different times, changing the env_list and space_list values to validate that the workflow behaves as expected for different environment and space combinations.

Issue(s)

Checklists

Every PR

  • Meets issue criteria
  • JIRA ticket status updated
  • Code is meaningfully tested
  • Meets accessibility standards (WCAG 2.1 Levels A, AA)
  • API Documentation updated
  • Boundary diagram updated
  • Logical Data Model updated
  • Architectural Decision Records written for major infrastructure decisions
  • UI review complete

Before merge to main

  • OHS demo complete
  • Ready to create production PR

Production Deploy

  • Staging smoke test completed

After merge/deploy

  • Update JIRA ticket status

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant