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!

How to re-deploy using the API endpoint?



  • I'm trying to use the endpoint "api/releases/packages/deploy" to deploy a release to an environment that has already received the deployment (analogous to "Re-deploy to Stage" option available via the screens), but I'm getting an error

    Invoke-WebRequest : 2627141Builds_PromoteBuild28`Violation of UNIQUE KEY constraint 'UQ__BuildPromotions'. Cannot insert duplicate key in object 'dbo.BuildPromotions'. The
    duplicate key value is (84564, Stage).

    Is there a different endpoint for re-deployment?

    Note that in this scenario, we don't need to rebuild the package, we just need to re-release the code.

    Product: BuildMaster
    Version: 5.6.8



  • This appears to be a bug I've filed a fix here: https://inedo.myjetbrains.com/youtrack/issue/BM-3109



  • Thanks Tod. The bug ticket sounds like it will just prevent the error. Are there plans to create an API that will actually re-deploy to a stage?



  • It's just an unfortunate mix of terminology in "promotion" vs "deployment" vs "execution". A "promotion" is simply allowing a package to be deployed to the stage and should only happen once per release. A "deployment" can happen anywhere but may be restricted by pipeline settings depending on if the package was previously promoted, and an "execution" is essentially the worker that performs the deployment (and there could be many per deployment).

    The fix will make it perform a deployment instead of a promotion then a deployment, so it will work as you're expecting.



Inedo Website HomeSupport HomeCode of ConductForums GuideDocumentation