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
-
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
-
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; } }
-
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 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; }
-
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;
-
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...
-
Done... ticket #EDO-1612....
hope it helps, and thanks in advance for all your efforts and attention.