pub struct RuntimeContext {
pub base: ExecutionContext,
pub current_stage: Option<String>,
pub current_job: Option<String>,
pub stage_results: HashMap<String, StageResult>,
pub job_results: HashMap<String, JobResult>,
pub step_results: Vec<StepResult>,
pub variables: HashMap<String, Value>,
pub parameters: HashMap<String, Value>,
pub env: HashMap<String, Value>,
pub step_outputs: HashMap<String, HashMap<String, Value>>,
}Expand description
Runtime context during pipeline execution
Fields§
§base: ExecutionContextBase execution context (pipeline name, working dir, etc.)
current_stage: Option<String>Current stage being executed
current_job: Option<String>Current job being executed
stage_results: HashMap<String, StageResult>Completed stage results
job_results: HashMap<String, JobResult>Completed job results (indexed by “stage.job” or just “job” for implicit stage)
step_results: Vec<StepResult>Current job’s step results
variables: HashMap<String, Value>All variables (merged from pipeline, stage, job levels)
parameters: HashMap<String, Value>All parameters
env: HashMap<String, Value>Environment variables
step_outputs: HashMap<String, HashMap<String, Value>>Output variables from steps (step_name -> output_name -> value)
Implementations§
Source§impl RuntimeContext
impl RuntimeContext
Sourcepub fn new(base: ExecutionContext) -> Self
pub fn new(base: ExecutionContext) -> Self
Create a new runtime context from base execution context
Sourcepub fn from_pipeline(pipeline: &Pipeline, working_dir: String) -> Self
pub fn from_pipeline(pipeline: &Pipeline, working_dir: String) -> Self
Create a new runtime context from a pipeline
Sourcepub fn enter_stage(&mut self, stage: &Stage)
pub fn enter_stage(&mut self, stage: &Stage)
Enter a stage (set current stage and merge variables)
Sourcepub fn exit_stage(&mut self, result: StageResult)
pub fn exit_stage(&mut self, result: StageResult)
Exit current stage with result
Sourcepub fn record_step_result(&mut self, result: StepResult)
pub fn record_step_result(&mut self, result: StepResult)
Record a step result
Sourcepub fn set_variable(&mut self, name: String, value: Value)
pub fn set_variable(&mut self, name: String, value: Value)
Set a variable during execution
Sourcepub fn set_step_output(
&mut self,
step_name: String,
output_name: String,
value: Value,
)
pub fn set_step_output( &mut self, step_name: String, output_name: String, value: Value, )
Set an output variable for the current step
Sourcepub fn merge_pipeline_variables(&mut self, variables: &[Variable])
pub fn merge_pipeline_variables(&mut self, variables: &[Variable])
Merge pipeline-level variables (public entry point for the executor)
Sourcepub fn to_expression_context(&self) -> ExpressionContext
pub fn to_expression_context(&self) -> ExpressionContext
Build an ExpressionContext for evaluating conditions
Sourcepub fn expression_engine(&self) -> ExpressionEngine
pub fn expression_engine(&self) -> ExpressionEngine
Create an expression engine with current context
Sourcepub fn evaluate_condition(&self, condition: &str) -> Result<bool, String>
pub fn evaluate_condition(&self, condition: &str) -> Result<bool, String>
Evaluate a condition expression
Sourcepub fn substitute_variables(&self, text: &str) -> Result<String, String>
pub fn substitute_variables(&self, text: &str) -> Result<String, String>
Substitute variables in a string ($(var) syntax)
Sourcepub fn dependencies_succeeded(&self, deps: &[String], is_stage: bool) -> bool
pub fn dependencies_succeeded(&self, deps: &[String], is_stage: bool) -> bool
Check if all dependencies succeeded
Sourcepub fn env_as_strings(&self) -> HashMap<String, String>
pub fn env_as_strings(&self) -> HashMap<String, String>
Get environment variables as string map for process execution
Trait Implementations§
Source§impl Clone for RuntimeContext
impl Clone for RuntimeContext
Source§fn clone(&self) -> RuntimeContext
fn clone(&self) -> RuntimeContext
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl Freeze for RuntimeContext
impl RefUnwindSafe for RuntimeContext
impl Send for RuntimeContext
impl Sync for RuntimeContext
impl Unpin for RuntimeContext
impl UnsafeUnpin for RuntimeContext
impl UnwindSafe for RuntimeContext
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more