Lesson 5: Adding tasks to the deployment plan

Add tasks to the segments in the deployment plan.

The tutorial assumes that you are doing each lesson in the order it is presented. Before you start this lesson, make sure that you complete the previous lessons.
In this lesson, you add tasks to the three segments in the Default Plan. The manual, signal, and wait tasks that you add to the plan make a simple deployment. The techniques that you learn to control the workflow with prerequisite segments and dependent tasks can be used in any deployment you create.
  1. From the IBM® UrbanCode™ Release dashboard, click Releases and Deployments, and then click Deployment Plans.
  2. Click the Default Plan link for the Demo Release.
  3. Click Add Task for the Pre-Deployment Tasks segment, and then select Manual Task.
    The Add New Task window is displayed, as shown in the following figure:

    Add New Task window

    All tasks are configured with the Add New Task window, although there are some differences among the task types. You also access this window to edit tasks. When a deployment starts, an additional tab, Comments, becomes available in this window. You can use the Comments tab to add comments to running tasks.

  4. In the name field, enter Notify Data Center about the Maintenance Window.
    Because manual tasks have no intrinsic value and can represent any activity that is related to a software release, it's important to use meaningful names when you create manual tasks. This task is the first task that can be started in this segment, and because this segment starts the deployment, it is the first task eligible to start.
  5. In the Description field, enter Data center contact information listed below.
    Because the person who completes the task might not be the same person who creates it, a meaningful description is also important. You can use the editing tools to add as much information to the description as you need. You can paste text and add links to other information important for completing the task.
  6. In the Duration list, select 5.
    You are estimating that the task takes 5 minutes to complete.
  7. In the Executor Role list, select Release Manager.
    Only a team member in the Release Manger can run the task.
    Note: The default user account of releaser is assigned to the Release Manager Role. If you created your own user and role with the required permissions, you can use that role instead. See the prerequisites for information about creating roles with the required permissions.
  8. Accept the default values for the other fields and click Save.
    The task is inserted into the Pre-Deployment Tasks segment.
  9. Complete these steps to add another task to the Pre-Deployment Tasks segment:
    1. Click Add Task for the Pre-Deployment Tasks segment, and then select Manual Task.
    2. Using the Add New Task window, in the Name field, enter Verify target hosts are ready, or some other suitable name.
    3. In the Description box, enter Relevant URLS are listed below, or text that is related to the name you gave the task.
    4. In the Duration list, select 5.
    5. In the Executor Role list, select Release Manager.
    6. Click Save.
    The task is inserted in the segment below the first task that you created. Tasks are always added to the bottom of the task list. You can drag tasks to reorder them within a segment, and you can even drag them to other segments.

The Pre-Deployment Tasks segment starts as soon as the deployment starts. Because the execution pattern is Sequential with Sequential Enforced, the Verify target hosts are ready task cannot start until the Notify Data Center about the Maintenance Window task is finished.

Because the segment's execution pattern is Sequential, task durations are added to calculate the segment's overall duration. The Pre-Deployment Tasks segment's duration is estimated to be 10 minutes.

The tasks for the Pre-Deployment Tasks segment are shown in the following figure:


Tasks for the Pre-Deployment Tasks segment

Adding tasks to the Deployment Tasks segment

Add a manual task, signal task, and a task prerequisite to the deployment plan.

Because this segment has the preceding one as a prerequisite, it cannot start until all tasks in the preceding segment are complete. If it did not have a prerequisite segment, its tasks could start as soon as the deployment starts. A deployment's overall duration is determined by how you sequence its segments, and by the execution pattern of its segments. In this case, the deployment's duration is calculated by adding the duration of the first two segments.
  1. Complete these steps to add a manual task to the Deployment Tasks segment:
    1. Click Add Task for the Deployment Tasks segment, and then select Manual Task.
    2. Using the Add New Task window, in the Name field, enter Deploy DB changes, or some other suitable name.
    3. In the Description box, enter DB credentials listed below, or text that is related to the name you gave the task.
    4. In the Duration list, select 5.
    5. In the Executor Role list, select Release Manager.
    6. Click Save.
    The task is inserted in the Deployment Tasks segment.
  2. Complete these steps to add a signal task to the Deployment Tasks segment:
    1. Click Add Task for the Deployment Tasks segment, and then select Signal Task.
      Signal-type tasks work with wait-type tasks. When a signal task runs, it alerts, or signals, associated wait tasks. Signal and wait tasks automatically perform their function as soon as they are eligible to run without user intervention. Signal tasks can be used with wait tasks within the same deployment plan, or with wait tasks in other deployments. Signal and wait tasks can also be used to coordinate enterprise-wide release events that involve multiple releases. Later in this lesson, you create a corresponding wait task.
    2. In the Add Signal Task dialog box, select Create New Checkpoint.
    3. In the New Checkpoint Name field, enter DB Changes Done.
      A checkpoint is an object that maintains the state of associated signal and wait tasks. To be effective, each signal task needs at least one associated wait task. To put it another way, each checkpoint must have at least one signal task and at least one wait task associated with it.
    4. Click Save.
      The task is inserted in the Deployment Tasks segment as Signal DB Changes Done. Signal-type tasks always have "Signal" appended to their name. Signal- and wait-type tasks cannot have user roles assigned to them.
    5. Display the action list for the Signal DB Changes Done, and then select Add Prerequisite Task.
      You must save a task before you can add a dependent or prerequisite task to it.

      The action list is available for all tasks.


      Task actions
    6. In the Add Task Prerequisite window, click Deployment Tasks, and then select Deploy DB Changes--No Application.
      Tasks, like segments, can have other tasks as prerequisites. A dependent task cannot start until all its prerequisites are complete. You can create dependencies between tasks in other segments. However, unlike signal and wait tasks, you cannot create dependencies between tasks in separate deployments or releases. If you want to do that, use signal and wait tasks instead.
    7. Click Save.
      The Signal DB Changes Done task's line displays Dependencies: 1.

By making the Deploy DB Changes task a prerequisite for the Signal DB Changes Done task, the latter cannot start until the former is complete. And because signal tasks run as soon as they are eligible, it runs as soon as the manual task Deploy DB Changes is complete.

The duration for the Deployment Tasks segment is 6 minutes. By default, signal and wait tasks have a duration of 1 minute. The tasks for the Deployment Tasks segment are shown in this figure:


Ordered segments

Adding tasks to the Deployment Tasks II segment

Add a manual task, wait task, and a task prerequisite to the deployment plan.

This segment illustrates another method that you can use to control a deployment's workflow. This segment has no prerequisites and starts when the deployment starts, just like the first segment. But because you will add a wait task for the signal task in the preceding segment, the tasks in this segment are the last to complete.
  1. Complete these steps to add a wait task to the Deployment Tasks II segment:
    1. Click Add Task for the Deployment Tasks II segment, and then select Wait Task.
      Wait tasks start as soon as they are eligible to run. Started wait tasks have a status of In Progress until they receive signals from all associated signal tasks.
    2. In the Add Wait Task dialog box, select Use Existing Checkpoint.
    3. In the Existing Checkpoint list, select the checkpoint that you created earlier, DB Changes Done.
    4. Click Save.
      The task, Wait for DB Changes Done, is added to the segment. The task line displays Dependencies: 0. Wait tasks are not considered dependent on their corresponding signal tasks. If you make a wait task dependent on manual or automatic tasks, the wait task cannot start until its prerequisite tasks are complete.
  2. Complete these steps to add a manual task to the Deployment Tasks II segment:
    1. Click Add Task for the Deployment Tasks II segment, and then select Manual Task.
    2. Using the Add New Task window, in the Name field, enter Deploy Web app, or some other suitable name.
    3. In the Description box, enter Relevant WAR files listed below, or text that is related to the name you gave the task.
    4. In the Duration list, select 10.
    5. In the Executor Role list, select Release Manager.
    6. Click Save.
      The task is inserted in the Deployment Tasks II segment.
    7. Display the action list for the Deploy Web app, and then select Add Prerequisite Task.
    8. In the Add Task Prerequisite window, click Deployment Tasks II, and then select Wait for DB Changes Done.
    9. Click Save.
      The task's line displays Dependencies: 1. It is typical to have tasks dependent on wait tasks. You can, for example, coordinate multi-release events by using this technique.

The manual task cannot start until the Wait for DB Changes Done task is complete, that is, until it receives a signal from the Signal DB Changes Done task.

Lesson checkpoint

In this lesson, you added tasks to the deployment plan and defined the workflow by using segment and task dependencies.

By creating dependencies, you defined the workflow for any deployment done with this deployment plan. The tasks in the plan's segments are done in the order in which the segments are listed. By using the techniques that are learned in this lesson, you can control a deployment's workflow even for deployments with many segments and tasks.


The finished deployment plan

For more information about creating tasks, see Creating manual tasks.