Choose your language:
    Update build trigger
    Parameters
    name  string  Optional

    Name of the environment

    adapter  string  Optional

    The deploy adapter

    indexingEnabled  boolean  Optional

    Enable scraper on the site

    frontendUrl  string, null  Optional

    Public url of the site

    autotriggerOnScheduledPublications  boolean  Optional

    Deploy on scheduled publication

    adapterSettings  object  Optional

    Additional configuration for deploy

    Returns
    Returns a build_trigger object.

    Examples

    Example code:
    const SiteClient = require('datocms-client').SiteClient;
    const client = new SiteClient('YOUR-API-TOKEN');
    const buildTriggerId = '1822';
    client.buildTrigger.update(buildTriggerId, {
    name: 'Production',
    adapter: 'netlify',
    indexingEnabled: true,
    frontendUrl: 'https://www.mywebsite.com/',
    autotriggerOnScheduledPublications: true,
    adapterSettings: {
    triggerUrl: 'https://api.netlify.com/build_hooks/XXX',
    siteId: 'XXX',
    branch: 'master'
    }
    })
    .then((buildTrigger) => {
    console.log(buildTrigger);
    })
    .catch((error) => {
    console.error(error);
    });
    Returned output:
    > node example.js
    {
    "id": "1822",
    "name": "Production",
    "adapter": "netlify",
    "adapterSettings": {
    "triggerUrl": "https://api.netlify.com/build_hooks/XXX",
    "siteId": "XXX",
    "branch": "master"
    },
    "lastBuildCompletedAt": "2017-03-30T09:29:14.872Z",
    "buildStatus": "success",
    "webhookToken": "xA1239ajsk123",
    "webhookUrl": "https://webhooks.datocoms.com/xA1239ajsk123/deploy-results",
    "indexingStatus": "success",
    "frontendUrl": "https://www.mywebsite.com/",
    "autotriggerOnScheduledPublications": true,
    "indexingEnabled": true
    }