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!

Are the API endpoints for keyword "packages" still valid in 6.1.0?



  • In the notes for BM-3257 it says "Things not changed: Release & Package Deployment API". However, when I upgraded from BM 6.0.9 to 6.1.0, my implementation of /releases/packages/deploy stopped working. To get it working I needed to change the variable name in the body from "packageNumber" to "buildNumber".

    I also noticed that the on-line documentation only mentions endpoints using the "build" keyword, like releases/builds/deploy. There is no mention of a packages endpoint (https://inedo.com/support/documentation/buildmaster/reference/api/release-and-package)

    Were the /packages/ endpoints deprecated in a prior release?

    Product: BuildMaster
    Version: 6.1.0


  • inedo-engineer

    Both are supposed to be supported, and quickly inspecting the code itself, I see both as possible arguments:

    isMatch("builds") || isMatch("packages")

    and

    BuildId = AH.ParseInt(request["buildId"] ?? request["packageId"]),
    BuildNumber = request["buildNumber"] ?? request["packageNumber"],
    

    Perhaps it's JSON parsing related? Are you POSTing as application/json?



  • Thanks for getting back to me. Yes, I'm posting using the application/json content type. Below is a powershell code sample that illustrates the issue.

    # this creates the package.
    $body = "{
        applicationId: ""${APP}"",
        releaseNumber: ""${RELNUM}"",   
        API_key: ""${APIKey}""
    }"
    
    $results = (Invoke-WebRequest -Uri "http://${Servername}:81/api/releases/packages/create" -Method Post -Body $body -ContentType "application/json" -UseBasicParsing).content | ConvertFrom-Json
    $PackageNumber = $results.number
    
    # this fails with a message of "Could not determine build ID. A build id or build number, release id/name, application id/name is required."
    $body = "{
        applicationId: ""${APP}"",
        releaseNumber: ""${RELNUM}"",
        packageNumber: ""${PackageNumber}"",   
        API_key: ""${APIKey}"",
        toStage: ""Run""
    }"	
    Invoke-WebRequest -Uri "http://${Servername}:81/api/releases/packages/deploy" -Method Post -Body $body -ContentType "application/json" -UseBasicParsing
    
    # change the var name from "packageNumber" to "buildNumber" in the body and it works.
    $body = "{
        applicationId: ""${APP}"",
        releaseNumber: ""${RELNUM}"",
        buildNumber: ""${PackageNumber}"",   
        API_key: ""${APIKey}"",
        toStage: ""Run""
    }"	
    Invoke-WebRequest -Uri "http://${Servername}:81/api/releases/packages/deploy" -Method Post -Body $body -ContentType "application/json" -UseBasicParsing

  • inedo-engineer

    Thanks, I've filed this as a bug here: BM-3307



Inedo Website HomeSupport HomeCode of ConductForums GuideDocumentation