deploydb/doc/workflow.adoc

2.9 KiB
Raw Permalink Blame History

<html lang="en"> <head> </head>

#DeployDB WorkFlow

Note
  • Artifacts - A1, A2

  • Deployments - D1, D2, D3

  • Flow - F1

  • Environments - 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 Status=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

    3. Set Flow Status=CREATED

  5. Get next Deployment D1 from the list (w/ Status=NOT_STARTED)

    1. Update Deployment (D1) Status=CREATED

    2. 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 Deployment (D1) Status=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) Status=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 Deployment (D1) with Promotion-Status=FAILED

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

      3. Update Deployment (D1) Status=FAILED

      4. Update Flow (F1) Status=FAILED

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

      1. Update Deployment (D1) with Promotions (P1) Status=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 (D1) Status=SUCCESS

    2. Get next deployment (D2) from the list (w/ Status=NOT_STARTED)

      1. For each webhook for Deployment-created:

    3. Update Deployment (D2) Status=CREATED

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

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

    4. If no deployments in the list with Status=NOT_STARTED,

      1. Update Flow (F1) Status=SUCCESS

</html>