Adding a scheduled build to the build configuration

Chrono

I'm currently working on a script that changes some configuration on a build definition. One of these changes is to add a trigger that schedules a build to run every weekday at 2 am.

My approach was to manually add the trigger first and then reproduce it with API calls. The configuration leads to the following in the build definition:

"triggers": [
    {
        "schedules": [
            {
                "branchFilters": [
                    "+$/<removed>"
                ],
                "timeZoneId": "W. Europe Standard Time",
                "startHours": 2,
                "startMinutes": 0,
                "daysToBuild": 31,
                "scheduleJobId": "f3bf0e7e-8cde-4d91-8e3d-63bf3e29d256",
                "scheduleOnlyWithChanges": true
            }
        ],
        "triggerType": "schedule"
    }
],

My problem is that when I make this change through the API there are no changes.

I PUT the edited JSON definition to "${vstsBaseUrl}/build/definitions/${id}?api-version=5.0-preview.4" (PowerShell script) and still receive a 200 OK, but my change has not been commited.

The revision number also does not increase. But the latest version of the build definition is sent as response.

Updating without a "scheduleJobId" does not help.

Andy Li-MSFT

That's because you didn't specify the correct build definition revision, you need to specify the latest revision to update the definition.

So, you can use REST API to get the build definition revision first. Then use that revision in your request body to update the build definition.

enter image description here

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

Adding a build configuration in Xcode

From Dev

Not adding to the Build queue when a scheduled run does not complete

From Dev

Adding a custom preset build configuration to make

From Dev

VC++ 2010 - Adding configuration to a single project in a solution fails to build

From Dev

Adding a Trigger to a build configuration in TeamCity using the REST API

From Dev

VC++ 2010 - Adding configuration to a single project in a solution fails to build

From Dev

Visual Studio Scheduled Build Trigger

From Dev

Programmatically check the build configuration

From Dev

Build configuration history in teamcity

From Dev

TeamCity Build Chain configuration

From Dev

Oasis build configuration with subdirectories

From Dev

Programmatically check the build configuration

From Dev

Configuration of plugin build for Jenkins

From Dev

Adding module name in Gradle build

From Dev

Adding files to bundle on meteor build

From Dev

Adding PhoneGap Build Android requirements

From Dev

Adding filetransfer in PhoneGap breaks build

From Dev

Adding codegen flags to a Cargo build

From Dev

Adding synx to XCode build phase

From Dev

Adding files to bundle on meteor build

From Dev

What is the default build configuration of cmake

From Dev

Set a default build configuration for project

From Dev

Global configuration for GHC build flags

From Dev

How to archive a build configuration in Teamcity?

From Dev

Save Visual Studio Build Configuration

From Dev

Running build configuration from another

From Dev

Get return value of build configuration

From Dev

Unit Tests, Build Configuration and Internals

From Dev

Running build configuration from another

Related Related

HotTag

Archive