Create bot triggers

Bots can be configured to perform actions—known as triggers—before and after integration when you create a bot or on the Triggers pane, when you edit a bot. A trigger can run custom shell scripts and send email reports.

A pre-integration script or a post-integration script can use any environment variables you defined in the previous sheet when you create a bot, or on the Arguments pane, when you edit a bot. The script can also use any of the Xcode Server environment variables.

Create a pre-integration trigger

Pre-integration triggers run after your project is checked out from the source control repository and before your project builds.

  1. Click the Add button (+) and choose Pre-Integration Script from the pop-up menu.

  2. In the left column, enter a title for the trigger.

  3. On the right, enter the script in the editor area.

Create a post-integration trigger

Post-integration triggers run after an integration.

  1. In the lower-left corner, click the Add button (+) and choose Post-Integration Script from the pop-up menu.

  2. In the left column, enter a title for the trigger.

  3. On the right, enter the script in the editor area.

  4. Above the editor, select the checkboxes for the events that you want to trigger the script.

    Post-integration triggers may be configured to run conditionally, such as on success, on test failures, on build errors, on build warnings, or on static analysis warnings. Select the appropriate condition checkboxes for your integration.

Create an email notification trigger

Email notification triggers run when new issues occur, after performing an integration, daily, or weekly.

  1. In the lower-left corner, click the Add button (+) and choose either New Issue Email or Periodic Email Report from the pop-up menu.

  2. On the right, enter the sender and recipient information.

  3. For a periodic email trigger, choose Daily or Weekly from the Schedule pop-up menu.

  4. Select the appropriate Options, Include, and Notify On checkboxes to further configure the email trigger.

    For periodic reports, specify whether you want email to go to committers. For new issue reports, emails automatically go to committers but you can specify whether to send email when issues are resolved too. Then select the information to include and the conditions under which reports are sent, such as on success, on test failures, on build errors, on build warnings, or on static analysis warnings.

    For a new issue email, the settings appear as:

Delete a trigger

  1. In the left column, select the trigger.

  2. In the lower-left corner, click the Delete button (–).

See alsoContinuous integration using Xcode ServerCreate a bot