Inedo Community Forums Forums
    • Recent
    • Tags
    • Popular
    • Login

    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

    Scheduled Pinned Locked Moved Support
    buildmasterapipromotionsbuilds
    2 Posts 2 Posters 19 Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • N Offline
      nsitnikov_5096
      last edited by

      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

      1 Reply Last reply Reply Quote 0
      • jraschJ Offline
        jrasch inedo-engineer
        last edited by

        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.

        1 Reply Last reply Reply Quote 0

        Hello! It looks like you're interested in this conversation, but you don't have an account yet.

        Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

        With your input, this post could be even better 💗

        Register Login
        • 1 / 1
        • First post
          Last post
        Inedo Website Home • Support Home • Code of Conduct • Forums Guide • Documentation