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!

    How to use $ReferencedReleaseNumber and $ReferencedPackageNumber

    Scheduled Pinned Locked Moved Support
    buildmaster
    7 Posts 1 Posters 4 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.
    • ? This user is from outside of this forum
      Guest
      last edited by

      Hi,
      can you help me with an example of how to use it? in the sample below only retrieves the deployable name but not the numbers that I need.

      # Loop
      foreach $Deployable in @DeployablesInRelease
      {
          set $BuildComponents = $BuildComponents + $Deployable $ReferencedReleaseNumber.$ReferencedPackageNumber
          Log-Debug  $BuildComponents;
      
      }
      

      Many thanks.

      Product: BuildMaster
      Version: 5.2.3

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

        There are a few ways to solve this...

        The $ReferencedReleaseNumber will use the current deployable in context, unless another was specified (e.g. $ReferencedReleaseNumber(myDeployableName)) as an argument.

        Based on the OtterScript, it doesn't look like you have a deployable in context. The foreach loop is just putting one of the items from the @DeployablesInRelease list into a scalar variable.

        # Option 1 (context iteration statement)
        foreach deployable in @DeployablesInRelease
        {
            set $BuildComponents = $BuildComponents + $DeployableName $ReferencedReleaseNumber.$ReferencedPackageNumber;
            Log-Debug  $BuildComponents;
        }
        
        # Option 2 (usage of parameter in variable function)
        foreach $Deployable in @DeployablesInRelease
        {
             set $BuildComponents = $BuildComponents + $Deployable $ReferencedReleaseNumber($Deployable).$ReferencedPackageNumber($Deployable);
        Log-Debug  $BuildComponents;
        }
        
        # Option 3 (set context statement)
        foreach $Deployable in @DeployablesInRelease
        {
             for deployable $Deployable
             {
                 set $BuildComponents = $BuildComponents + $Deployable $ReferencedReleaseNumber.$ReferencedPackageNumber;
                 Log-Debug  $BuildComponents;
             }
        }
        
        1 Reply Last reply Reply Quote 0
        • ? This user is from outside of this forum
          Guest
          last edited by

          Hi,
          I try all the options, but the option 1 and 3 does not returns the numbers...and option 2 produces an error:

          Unhandled exception: System.FormatException: Invalid name.
          at Inedo.BuildMaster.Extensibility.VariableFunctions.Deployable.ReferencedDeployableFunctionBase.EvaluateScalar(IGenericBuildMasterContext context)
          at Inedo.BuildMaster.Extensibility.VariableFunctions.ScalarVariableFunction.Evaluate(IGenericBuildMasterContext context)
          at Inedo.BuildMaster.BuildMasterVariableEvaluationContext.TryEvaluateFunction(RuntimeVariableName functionName, IList`1 arguments)
          at Inedo.ExecutionEngine.Variables.FunctionTextValue.Evaluate(IVariableEvaluationContext context)
          at Inedo.ExecutionEngine.Variables.ProcessedString.Evaluate(IVariableEvaluationContext context)
          at Inedo.BuildMaster.Windows.ServiceApplication.Executions.PlanExecuter.DeploymentPlanExecuter.EvaluateExpressionAsync(String expression, IExecuterContext context)
          at Inedo.ExecutionEngine.Executer.ExecuterThread.<EvaluateExpressionAsync>d__70.MoveNext()
          --- End of stack trace from previous location where exception was thrown ---
          at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
          at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
          at Inedo.ExecutionEngine.Executer.ExecuterThread.<ExecuteAsync>d__49.MoveNext()
          --- End of stack trace from previous location where exception was thrown ---
          at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
          at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
          at Inedo.ExecutionEngine.Executer.ExecuterThread.<ExecuteNextAsync>d__34.MoveNext()

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

            | 1 and 3 does not returns the numbers

            What numbers are you expecting? Are you just seeing "deployable + ." as the result?

            Can you confirm the deployables are, in fact, referenced in the release?

            CAn you try to log the additional info?

            foreach $Deployable in @DeployablesInRelease
            {         
                Log-Debug  $Deployable;
            }
            
            1 Reply Last reply Reply Quote 0
            • ? This user is from outside of this forum
              Guest
              last edited by

              Hi,

              When I create a new package I can select the deployables that I want to include into the new one, and If I exclude one, then I can select a version number for that deployable, then the target is to know Which deployables and in which version are included into the Release-Package...
              Something like this:

              Check-In Services v-7.1607.12.10; Check-In Finance Service v-7.1607.12.6; Check-In Client v-7.1607.12.6; DB Master v-7.1607.12.6; DB Event v-7.1607.12.6; DB Web v-7.1607.12.6; Check-In Finance Service v-7.1607.12.4; v-7.1607.12.4; v-7.1607.12.4;

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

                I'm struggling a bit trying to figure out how to reproduce the set-up; would you mind putting some steps on what we can do (screenshots in a Word doc are fine), as well as the OtterScript plans, then we can set something up similar, and figure out where the issue is...

                http://inedo.com/support/submit-ticket

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

                  Done... ticket #EDO-1612....
                  hope it helps, and thanks in advance for all your efforts and attention.

                  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