Welcome to the Inedo Forums! Check out the Forums Guide for help getting started.

If you are experiencing any issues with the forum software, please visit the Contact Form on our website and let us know!

Promote Build Using API



  • We are trying to promote an application build to a particular environment using API, but we can't seem to get it working. We created full (unrestricted) access key for this.
    Tried 2 type of calls:

    1. This one returns 404:

    http://bmserver:port/api/releases/builds/deploy?buildNumber=3&releaseId=722&applicationId=123&toStage=Development&key=<APIKey>

    1. This one returns 500 server error:

    http://bmserver:port/api/json/Builds_PromoteBuild?Application_Id=123&Release_Number=0.0.4&Build_Number=3&Comments_Text=SomeText&ForcePromotion_Indicator=N&PromoteTo_PipelineStage_Name=Development&SetFurthestStage_Indicator=N&key=<APIKey>

    1. Calling another method with the same API key works fine:

    http://bmserver:port/api/json/Builds_GetExecution?Execution_Id=25537&key=<APIKey>

    Tried switching between releaseId/releaseNumber didn't help much. Can you provide a complete sample call to promote/deploy a build?

    Thanks

    Product: BuildMaster
    Version: 5.8.2


  • inedo-engineer

    Here is a working PowerShell example (v6.1+):

    Invoke-RestMethod -Method POST -Uri "http://{bmserver:port}/api/releases/builds/deploy?applicationName=ApiTest&releaseNumber=1.2.3&buildNumber=1&key=<api-key>"

    For pre-v6.1 versions, the equivalent is:

    Invoke-RestMethod -Method POST -Uri "http://{bmserver:port}/api/releases/packages/deploy?applicationName=ApiTest&releaseNumber=1.2.3&packageNumber=1&key=<api-key>"

    I have also put in a doc change request to clarify the endpoint names.

    Additional note: -UseDefaultCredentials would be required if Integrated Authentication were enabled.



Inedo Website HomeSupport HomeCode of ConductForums GuideDocumentation