Inedo Community Forums Forums
    • Recent
    • Tags
    • Popular
    • Login

    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

    Scheduled Pinned Locked Moved Support
    buildmaster
    8 Posts 2 Posters 0 Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • J Offline
      jstarbird_7831
      last edited by

      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

      1 Reply Last reply Reply Quote 0
      • ? This user is from outside of this forum
        Guest
        last edited by

        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

        1 Reply Last reply Reply Quote 0
        • ? This user is from outside of this forum
          Guest
          last edited by

          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.

          1 Reply Last reply Reply Quote 0
          • ? This user is from outside of this forum
            Guest
            last edited by

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

            1 Reply Last reply Reply Quote 0
            • ? This user is from outside of this forum
              Guest
              last edited by

              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.

              1 Reply Last reply Reply Quote 0
              • ? This user is from outside of this forum
                Guest
                last edited by

                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.

                1 Reply Last reply Reply Quote 0
                • ? This user is from outside of this forum
                  Guest
                  last edited by

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

                  1 Reply Last reply Reply Quote 0
                  • ? This user is from outside of this forum
                    Guest
                    last edited by

                    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.

                    1 Reply Last reply Reply Quote 0

                    Hello! It looks like you're interested in this conversation, but you don't have an account yet.

                    Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

                    With your input, this post could be even better 💗

                    Register Login
                    • 1 / 1
                    • First post
                      Last post
                    Inedo Website Home • Support Home • Code of Conduct • Forums Guide • Documentation