Skip to content

AppVeyorWaitForBuildJob Task

Joseph Larionov edited this page Oct 31, 2019 · 2 revisions

Overview

The AppVeyorWaitForBuildJob task pauses a build until all the other jobs running under that build have completed. If there are no other jobs, it does nothing. If any of the other jobs fail, the task will also stop and fail the build. If the build is not running under AppVeyor, then this task does nothing.

The task uses the AppVeyor API to check if the current build has multiple jobs. If it has a single job, it does no work. If there are other jobs, it checks the status of each job every 10 seconds until all their status is not running and not queued. Once all the jobs have finished, the task completes successfully if all the jobs' final status are success. If any final status is not success, the task stops and fails the build.

You can control how often to check for an updated status with the CheckInternval property.

The task reports to the user every 60 seconds that it is still waiting for background jobs to finish. You can control this interval with the ReportInterval property.

To control which status the task considers "in progress", use the InProgressStatus property. Use the SuccessStatus property to control which status the task considers successful.

Properties

  • [String]ApiKeyID (mandatory): the ID of the API key holding the AppVeyor bearer token to use to make requests to the AppVeyor API. Add API keys to your build with the Add-WhiskeyApiKey function.
  • [TimeSpan]CheckInterval: the interval to check if background jobs have finished. The default is 00:00:10 (ten seconds).
  • [TimeSpan]ReportInterval: the interval to report to the user that the task is still checking for finished jobs. The default is 00:01:00 (one minute).
  • [String[]]InProgressStatus: a list of status that denote a job is still running. The default is running and queued.
  • [String[]]SuccessStatus: a list of status that denote when a job has completed successfully. The default is success.

Examples

Example 1

Build:
- AppVeyorWaitForBuildJobs:
    ApiKeyID: AppVeyorBearerToken

Demonstrates the minimum requirements for using this task.

Example 2

Build:
- AppVeyorWaitForBuildJobs:
    ApiKeyID: AppVeyorBearerToken
    CheckInterval: "00:00:30"
    ReportInterval: "00:00:30"

Demonstrates how to customize how often to check for job status changes and how often to report to the user that the task is still running. In this example, both intervals are set to 30 seconds.

Example 3

Build:
- AppVeyorWaitForBuildJobs:
    ApiKeyID: AppVeyorBearerToken
    InProgressStatus:
    - running
    - queued
    - some_new_status

Demonstrates how to control what status the task should interpret to mean a job is still running. In this case, if a job reports its status as running, queued, or some_new_status, the task will continue to wait until the job's status changes to something else.

Example 4

Build:
- AppVeyorWaitForBuildJobs:
    ApiKeyID: AppVeyorBearerToken
    SuccessStatus:
    - success
    - failed

Demonstrates how to control what job status the task should interpret to mean the jobs succeeded. In this example, the task will succeed and your build will continue if other jobs succeed or fail. (We don't recommend doing this as it means a failure in another job won't stop the rest of your build from running.)

Clone this wiki locally