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!

Raft variables are not working



  • I have decided that using the Raft Variables appears to be my best option for storing configuration data that is tied to the current raft. I was going to use JSON in File assets, but the Get-Asset operation requires that the raft is explicit, which will not work for the "Promotion" use case (only if there were some way to get the "Current" raft in a variable or something).

    I figured out how to add the "variable" file to the raft, and was able to debug the code that is reading the variable data (ReadVariables() in GitRaftRepositoryBase.cs of Git extension)

    This is what I have in that file currently:

    set %ChocolateyPackagesBuild = %(
        git.install: 2.18.0,
        nodejs.install: 10.11.0
    );
    
    set %ChocolateyPackagesCommon = %(
        googlechrome: 69.0.3497.9200,
        notepadplusplus.install: 7.5.7,
        git.install: 2.18.0,
        Sysinternals: 2018.7.19
    );
    

    But when the variable is used I get the error:

    Unhandled exception: System.ArgumentException: Invalid variable value type.
       at Inedo.Otter.Service.PlanExecuter.ExecutionVariable..ctor(RuntimeVariableName name, RuntimeValue value)
       at Inedo.Otter.Service.PlanExecuter.OtterPlanExecuter.TryGetGlobalVariable(RuntimeVariableName variableName, IExecuterContext context)
       at Inedo.ExecutionEngine.Executer.ExecuterThread.ResolveVariable(RuntimeVariableName name, IExecuterContext context)
       at Inedo.ExecutionEngine.Executer.ExecuterThread.ExecuterContext.GetVariableValue(RuntimeVariableName variableName)
       at Inedo.ExecutionEngine.Variables.VariableTextValue.<EvaluateAsync>d__7.MoveNext()
    --- End of stack trace from previous location where exception was thrown ---
       at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
       at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
       at Inedo.ExecutionEngine.Variables.ProcessedString.<EvaluateAsync>d__13.MoveNext()
    --- End of stack trace from previous location where exception was thrown ---
       at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
       at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
       at Inedo.ExecutionEngine.Executer.ExecuterThread.<ExecuteAsync>d__47.MoveNext()
    --- End of stack trace from previous location where exception was thrown ---
       at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
       at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
       at Inedo.ExecutionEngine.Executer.ExecuterThread.<ExecuteNextAsync>d__35.MoveNext()
    

    Is there something else I need to do in the variables file to make this work?

    Product: Otter
    Version: 2.0.10



  • After some digging I determined that Mpa (%) types are not currently supported. I was able to get past this by embedding JSON in a scalar string, and then use %FromJson() to convert to a Map type in OtterScript.


Log in to reply
 

Inedo Website HomeSupport HomeCode of ConductForums GuideDocumentation