<%@ page isELIgnored="true" %> <%@ taglib uri="cms" prefix="cms" %> Administrating Jobs

Administrating Jobs

Jobs are created, edited, copied, copied to another project, and deleted on the Main Administration page by selecting the appropriate icon. Any job may also be iterated (to allow for multi-platform builds, etc.) to run multiple times. AnthillPro also provides a way for you to create templated jobs, called a Library Job. Once a Library Job has been configured, it can be used by multiple projects or can be turned into a project-specific job. When used in concert with Reusable Workflow Definitions, the Library Job can provide fine-grained control over your AnthillPro processes, as well as cut down on the amount of configuration necessary when editing existing and creating new projects. See Reusing Workflow Definitions and Jobs for more.

Reusing Job Steps

It is possible to copy steps between jobs in the same project, between jobs is different projects, or past them within the same job. This allows you to reuse configured steps. Once the step has been copied and used to the new location, you can edit the step's settings to customize it for the particular job.

  1. Select the Copy Step icon (under the Actions menu) of every step to be copied.

  2. Once all the steps have been added to the clipboard, navigate to the destination project and then paste the step(s) into the appropriate job by selecting either the Paste or Paste and Remove icon on the clipboard.

  3. When pasted, the step(s) will appear at the end of the existing job. To move the step, use the grab tool (to the right of the step name) and drag the step to the desired location. To clear the clipboard, click the Remove icon.

  4. Make any necessary changes to the copied step.

  5. To clear the clipboard, click the Remove icon.

Iterate a Job

Use job iterations to run the same job multiple times. When used in conjunction with Job Iteration Properties, you can set the parameters for a single job to run with slight variations each time. For example, if you want to run a deployment on several machines, you can set a property on each iteration that identifies the machine (with an AnthillPro agent installed on it) to run the deployment on. Or, in the case of a multi-platform build, you can set iterations that will iterate the build across each platform. Before you begin, make sure:

  • You must have AnthillPro administrative privileges to iterate a job. See Manage Security.

  • A Project with an originating workflow and at least one job must already be active.

  • If you are planning on using job-iteration properties to determine which agent each iteration will run on, you will need to create a new Agent Filter Script. See Tools > anthill3-dev-kit.zip > Scripting > Example: Select Agents Based on Job-iteration Properties.

  • Corresponding properties must be set on the agent(s) so that when the agent filter script runs, it will select the correct agent(s). See Configure and Edit Agent Filters.

Configure Job Iterations:

  1. Go to Administration and select the workflow that contains the job to be iterated.

  2. On the workflow page, select the Definition tab.

  3. Click the job to be iterated and select Iterate Job from the menu.

  4. Configure Job Iterations:

    • Job. This is the name of the job to be iterated. This field is automatically populated by AnthillPro.

    • Iterations. Give the number of times this job is going to be iterated. Use -1 to iterate a number of times equal to the number of agents returned by the job's agent filter. If -1 is used, Unique Agents must be set to Yes. For example, if the agent filter returns 4 agents, setting the iterations to -1 will iterate the job four times.

    • Unique Agents. To have each iteration run on a unique (different) agent, check Yes. If the number of iterations set above is -1, you must check Yes here, otherwise the iterated job will fail.

      If you are planning on using job-iteration properties to determine which agent each iteration will run on, make sure you check No -- otherwise your jobs may fail. See Job Iteration Properties for more.

    • Run Parallel. Check Yes to run in parallel (default is No). Depending on your system, running parallel jobs may not be possible; however, running parallel jobs can significantly decrease build times.

  5. Click Set Iteration.

  6. To set job iteration properties, see Job Iteration Properties.