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!

Variables questions



  • First question, is there a link to a overview of the Variable hierarchy?
    I have a situation where I'd like to setup variables in a pipeline for a stage but also have those same variables available for setting at run time so I put them in a release template.
    However at run time I can fill in the variable but then it is not used during execution, instead the one in the pipeline is being used.

    Second question, I am also trying to possibly handle a situation where I will be reading in some values from a database which then determines the values for a loop. However, we also want to allow for the thing to be run manually with the person entering one value.
    So I was trying to use multiple variables and create a List in script but in my testing I can't seem to create a list.

    Here is what I've tried:

    set @custId = @ListInsert(@custId, $clientId,0);

    but when run I just keep getting an error: Could not Resolve Variable @custId

    Product: BuildMaster
    Version: 5.6.7



  • Please see Configuration Variables for how values are supposed to cascade.

    If set @custId = @ListInsert(@custId, $clientId,0); is your entire OtterScript, then it won't work because @custId is not yet declared.

    But this would work.

    set @custId = @();
    set @custId = @ListInsert(@custId, $clientId,0); 
    

    Also note the new syntaxes are available soon. http://inedo.com/otter/1.5



  • Thanks. Are those Declarations documented anywhere?
    I had looked for something like that but couldn't find anything and tried several variations but not that one.



  • I looked at the Configuration Variables area but it doesn't mention Pipeline variables and Release templates are not listed directly.
    So in the situation of a Pipeline stage having a variable with a value and then a release template variable set for the same stage with the same name and I'm running it manually so I get the prompt for the release template variables, fill it in and then shouldn't that value override the pipeline stage variable?
    If not then what is the suggested method of allowing a manual run and an automated run with the same plan/pipeline and wanting to be able to supply different values if it is run manually?



  • The syntax and behavior of OtterScript / execution engine is documented in the reference docs and grammar.

    As for configuration variables, it appears that is out of date. A pipeline variable should have a lower precedent than a deployment variable. If that's not the case, it's a bug, and you can work-around it by:

    • having a deployment variable called $ManuallyRun
    • tesing if $IsVariableDefined(ManuallyRun)


  • Yes that is a bug then. I'll submit a bug report.



Inedo Website HomeSupport HomeCode of ConductForums GuideDocumentation