Note
  • Artifacts - A1, A2

  • Deployments - D1, D2, D3

  • Flow - F1

  • Enviroments - E1, E2, E3

  • Pipelines - PL2 = (E1, E2, E3)

  • Promotions - P1, P2

  • PromotionResults = PR1, PR2

  • Services - S1 = (A1, A2), PL1, (P1, P2)

Trigger: Artifact create:

  1. Create Artifact (A1')

  2. Find Service (S1) affected by this Artifact for the given artifact (group-name:artifact-name)

    1. If multiple services are affected (S1 & S2), then repeat the following steps (i.e. create multiple Flows - F1, F2)

  3. For each Environment (E1, E2, E3) in the Pipeline (PL1) in Service (S1)

    1. Create deployments with State=not-started [D1, D2, D3]

    2. Deployment (D1) contains (E1, Promotions [P1, P2]), etc

  4. Create Flow (F1)

    1. Store Artifact (A1’), Service (S1), Deployments [D1, D2, D3]

    2. ArtifactId and ServiceId would be unique for the flow (key)

    3. Set Flow State=inProgress

  5. Get next Deployment D1 from the list (w/ state=notStarted)

    1. For each webhook for Deployment-created:

      1. For each action in the webhook create HookRequest (HR)

      2. Payload for all deployment HookRequests: A1', D1, S1, E1

Trigger: Deployment started:

  1. Lookup Deployment (D1) from the Id received in the trigger

  2. Update State=started

  3. For each webhook for Deployment-started

    1. For each action in the webhook create HookRequest (HR)

    2. Payload for all deployment HookRequests: A1', D1, S1, E1

Trigger: Deployment completed:

  1. Lookup Deployment (D1) from the Id received in the trigger

  2. Update deployment (D1) State=completed

  3. For each webhook for Deployment-completed

    1. For each action in the webhook create HookRequest (HR)

    2. Payload for all deployment HookRequests: A1', D1, S1, E1

Trigger: Promotion completed:

  1. Lookup Deployment (D1) from the Id received in the trigger

  2. Lookup Promotion (P1) from the Id received in the trigger

    1. If P1 resultStatus=failed in the PromotionResults in the trigger

      1. Update Depolyment (D1) with Promotion-state=failed

      2. From Service (S1) find failureStrategy (STOP to begin with)

      3. Update Deployment State=failed

      4. Update Flow State=failed

    2. If resultStatus=passed in the PromotionResults in the trigger

      1. Update Depolyment (D1) with Promotion’s (P1) State=success .For each webhook for Promotion-completed:

    3. For each action in the webhook create HookRequest (HR)

    4. Payload for all promotion hookRequests: A1', D1, S1, PR1

  3. If all promotions (i.e. P1 & P2) for this deployment (D1) are completed

    1. Update Deployment State=success

    2. Get next deployment (D2) from the list (w/ state=notStarted)

      1. For each webhook for Deployment-created:

        1. For each action in the webhook create HookRequest (HR)

        2. Payload for all deployment HookRequests: A1, D1, S1, E1

    3. If no deployments in the list with State=notStarted,

      1. Update Flow State=Success