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!

[BM] Preventing Build from deploying into further stage based on variable



  • Hi,
    We have a requirement where we want to prevent deploying to stages based on build variables (OR by any other means) if possible.
    We have three stages: DEV, UA and PROD.
    I am creating a build from TeamCity using Buildmaster API. When creating a build, I am also creating a build variable called "ChannelName". Which contains values of either "alpha", "beta" or "stable".
    I want to stop at DEV stage if ChannelName is "alpha". We shouldn't be able to deploy in further stages..
    We want to stop at UA stage if channel name is "beta" (So deployment should happen only in DEV and UA only)
    channel with "stable" should be able to deploy in all three stages.
    Does Buildmaster has something I can achieve it with?

    OctopusDeploy achieves this with the help of LifeCycles and Channels.



  • Hello @andy222
    One way is to use $PipelineStageName variable in your deployment script to block deployemnt at the required stage according your channelname var.
    The other way could be a stage requirement, but I haven't try this way.
    Best regards
    PhilippeC.


  • inedo-engineer

    Hi @andy222,

    To expand on this further. If you are looking for it to just skip the stage based on that variable and proceed to the next stage, then I would also suggests @philippe-camelio_3885 method of checking in OtterScript using the $PipelinStageName. If you are looking to block going further in the pipeline and stopping at a specific step, I would suggest using the Pipeline Stage Requirements and setting a Require Variable automated check. That can block deployment to a stage unless a variable is set to a specific value.

    Thanks,
    Rich


Log in to reply
 

Inedo Website HomeSupport HomeCode of ConductForums GuideDocumentation