Skip to content

Multiple on_stop action for an environment

Bala Kumar requested to merge multiple-onstop-for-an-environment into master

What does this MR do and why?

Introduces multiple on_stop action jobs for the same environment. It runs the on_stop action jobs that are defined in parallel (default system behaviour).

Related Customer request issue - #22456 (closed)

The implementation follows the same suggestion below which as discussed in #22456 (comment 835059613)

  • When an environment is stopped, find the latest deployment record of the environment.
  • Find the associted pipeline of the deployment record.
  • Group deployment records in the same pipeline/commit by each target environment. e.g. deployment-A and deployment-B are targetting the development environment.
  • Select only successfully-executed deployments. e.g. If a deployment job is still not executed yet, then don't run the corresponding on_stop job.
  • Trigger on_stop jobs of the deployments.

Screenshots or screen recordings

How to set up and validate locally

  1. single-on-stop-gitlab-ci.yml

  2. multiple-on-stop-gitlab-ci.yml

Can use the above .gitlab-ci.yml and test the scenarios as shown in the screen recordings.

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Closes #22456 (closed)

Edited by Bala Kumar

Merge request reports