Skip to content

Build On Push for Iris apps

App Factory provides the ability to create triggers, which are specialized jobs that are used to automate and run tasks for your projects.

Consider a scenario in which a developer wants to verify whether an app runs after code changes are pushed to the source control. The administrator can create a watcher that runs the build and test jobs whenever a change is pushed to the source code.

To create a watcher, you must create a Webhook in the SCM that you use for your App Factory projects. For more information about creating Webhooks, refer to the following sections.

After you create a webhook, you can create watcher jobs in App Factory. For more information, refer to Configuring a Watcher Job in App Factory.

Every project contains a sub-folder called Triggers in the Iris folder. The Triggers folder contains a job called createTrigger (to create auto-triggered jobs), and two sub-folders called watchers and schedulers (to store the created jobs).

Creating Webhooks in GitHub

Prerequisites

Make sure that you have permissions to change the settings of the GitHub repository.

Configuring a Webhook

  1. Open your GitHub repository in a web browser, navigate to SettingsWebhooks, and then click Add webhook.
    The Add webhook page opens.

  1. Configure the following parameters in the Add webhook page:

    • Set the Payload URL to: https://<App Factory domain>/github-webhook/
      For example: https://a1001.ci.voltmxcloud.com/github-webhook/
      For more information, refer to Payload URL Format.

      Note: The last forward slash in the Payload URL is mandatory.

    • Content type must be application/x-www-form-urlencoded

    • Jenkins verification does not require a Secret. Leave the field empty.
    • Select the Just the push event option. Only pushes of code to a specific branch trigger the Flyway job.
    • The Active option should be marked by default.

  2. After you configure the necessary parameters, click Add Webhook.
    The webhook is created.

  1. You can Edit or Delete a Webhook by clicking the respective button. For more information about Webhooks, refer to the GitHub Webhook Documentation.

Creating Webhooks in Bitbucket

Prerequisites

Make sure that you have permissions to change the settings of the Bitbucket repository.

Make sure you have the Stash Webhook to Jenkins for Bitbucket add-on installed.

Configuring a Webhook

  1. Open your BitBucket repository in a web browser, navigate to Repository SettingsWebhooks, and then click Add webhook.
    The Add webhook page opens.
  2. On the Add new webhook page, configure the following parameters:

    • Set the title to App Factory
    • Set the URL to: https://<App Factory domain>/github-webhook/
      For example: https://a1001.ci.voltmxcloud.com/github-webhook/
      For more information, refer to Payload URL Format.

      Note: The last forward slash in the Payload URL is mandatory.

    • Leave the status set to Active

    • Select the Triggers option for Repository push

  3. After configuring all parameters, click Save.

Configuring a Watcher Job in App Factory

  1. From the folder of your project, navigate to the Triggers sub-folder.

  1. In the Triggers folder, click the build icon for the createTrigger job.
    Alternatively, select the createTrigger job, and then select the Build with Parameters option from the left panel.

  1. For the CRON_SCHEDULE parameter, make sure that the field is blank.

  1. Configure the remaining parameters, which are the same as the buildIris job.

Jobs that are triggered by a push to the SCM are stored in the watchers folder. Every Watcher has a branch name in the name of Job to simplify job search.

Reference: Payload URL Format

The format of the Payload URL depends on the type of Git server. App Factory supports the following Git servers:

Server TypePayload URL
GitHub Server<App Factory URL>/github-webhook/
Bitbucket Server (Stash)<App Factory URL>/bitbucket-hook/