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 not being transformed



  • I have a bunch of Application variables that I want to use during deployment so I've set them for Execution, is this not the correct setting?
    The only options I have are Release, Build and Execution. I have some in the Build area that do work as well.
    These are variables that contain other variables, like:

    webpath = $basepath$sitename

    where the $basepath is a server or environment set variable and $sitename is set in the Application varibles as well.

    Product: BuildMaster
    Version: 4.9.5



  • I meant to add, that in the above example neither $basepath nor $sitename 's values come thru so webpath gets set as literally $basepath$sitename



  • Unlike text in a deployment plan, external values that come from an input box (Release, Build, Execution, etc) are not "evaluated" in the same manner as literal text. So, you need to use the built-in variable function $ExpandVariables in the plan to do this.

    For example, $ExpandVariables($webpath) will convert any variable expressions contained within $webpath to the appropriate value.

    Note in Otter / v5-style plans this is conceptually similar (see Strings & Values, and it uses $Eval instead.



  • Ok. Thanks. Didn't know about that one.



  • It appears there is a problem using the the $ExpandVariables with the IIS actions. I have one to Stop an AppPool and in the App Pool name contains a variable. If I try using it as is, without $ExpandVariables, then the the variable doesn't get expanded.
    If I add $ExpandVariables as you mentioned then then when that Action runs it just ends. No output, no errors, nothing, the deployment just stops.



  • This wouldn't be specific to IIS actions; you can test/verify by trying other actions, such as create file.

    For v4-style plans... if nothing is logged in the action itself, you may see the error at the top of the execution If the variables aren't expanded, then it's that they don't exist or there's a typo. That is the current behavior in v4.

    In v5, that will be considered an error. You will also be able to do a "log" statement.



  • Thanks. I found what I was doing wrong, was using MajorVersionNumber and forgot to put the (ReleaseNumber) part at the end of it.



  • So I stand corrected. This just doesn't work for me.
    I have an application variable set for the BUILD scope, it's a string with the other variable of $MajorVersionNumber in it and it will never get expanded regardless of how I use it.
    Is this variable not available during Build? It's marked as a Release variable which I took to mean anytime during the entire process, build, deploy, etc.


Log in to reply
 

Inedo Website HomeSupport HomeCode of ConductForums GuideDocumentation