pub struct PipelineJob<'a> { /* private fields */ }
Implementations§
Source§impl PipelineJob<'_>
impl PipelineJob<'_>
Sourcepub fn ado_set_pool(self, pool: impl AsRef<str>) -> Self
pub fn ado_set_pool(self, pool: impl AsRef<str>) -> Self
(ADO only) specify which agent pool this job will be run on.
Sourcepub fn ado_set_pool_with_demands(
self,
pool: impl AsRef<str>,
demands: Vec<String>,
) -> Self
pub fn ado_set_pool_with_demands( self, pool: impl AsRef<str>, demands: Vec<String>, ) -> Self
(ADO only) specify which agent pool this job will be run on, with additional special runner demands.
Sourcepub fn ado_new_named_variable(
self,
name: impl AsRef<str>,
value: impl AsRef<str>,
) -> Self
pub fn ado_new_named_variable( self, name: impl AsRef<str>, value: impl AsRef<str>, ) -> Self
(ADO only) Declare a job-level, named, read-only ADO variable.
name
and value
are both arbitrary strings, which may include ADO
template expressions.
NOTE: Unless required by some particular third-party task, it’s strongly
recommended to avoid using this method, and to simply use
ReadVar::from_static
to get a obtain a static variable.
DEVNOTE: In the future, this API may be updated to return a handle that
will allow resolving the resulting AdoRuntimeVar
, but for
implementation expediency, this API does not currently do this. If you
need to read the value of this variable at runtime, you may need to
invoke AdoRuntimeVar::dangerous_from_global
manually.
Sourcepub fn ado_new_named_variables<K, V>(
self,
vars: impl IntoIterator<Item = (K, V)>,
) -> Self
pub fn ado_new_named_variables<K, V>( self, vars: impl IntoIterator<Item = (K, V)>, ) -> Self
(ADO only) Declare multiple job-level, named, read-only ADO variables at once.
This is a convenience method to streamline invoking
Self::ado_new_named_variable
multiple times.
NOTE: Unless required by some particular third-party task, it’s strongly
recommended to avoid using this method, and to simply use
ReadVar::from_static
to get a obtain a static variable.
DEVNOTE: In the future, this API may be updated to return a handle that
will allow resolving the resulting AdoRuntimeVar
, but for
implementation expediency, this API does not currently do this. If you
need to read the value of this variable at runtime, you may need to
invoke AdoRuntimeVar::dangerous_from_global
manually.
Sourcepub fn ado_override_job_id(self, name: impl AsRef<str>) -> Self
pub fn ado_override_job_id(self, name: impl AsRef<str>) -> Self
Overrides the id of the job.
Flowey typically generates a reasonable job ID but some use cases that depend on the ID may find it useful to override it to something custom.
Sourcepub fn gh_set_pool(self, pool: GhRunner) -> Self
pub fn gh_set_pool(self, pool: GhRunner) -> Self
(GitHub Actions only) specify which Github runner this job will be run on.
Sourcepub fn gh_dangerous_override_if(self, condition: impl AsRef<str>) -> Self
pub fn gh_dangerous_override_if(self, condition: impl AsRef<str>) -> Self
(GitHub Actions only) Manually override the if:
condition for this
particular job.
This is dangerous, as an improperly set if
condition may break
downstream flowey jobs which assume flowey is in control of the job’s
scheduling logic.
See https://docs.github.com/en/actions/writing-workflows/workflow-syntax-for-github-actions#jobsjob_idif for more info.
Sourcepub fn gh_dangerous_global_env_var(
self,
name: impl AsRef<str>,
value: impl AsRef<str>,
) -> Self
pub fn gh_dangerous_global_env_var( self, name: impl AsRef<str>, value: impl AsRef<str>, ) -> Self
(GitHub Actions only) Declare a global job-level environment variable, visible to all downstream steps.
name
and value
are both arbitrary strings, which may include GitHub
Actions template expressions.
This is dangerous, as it is easy to misuse this API in order to write a node which takes an implicit dependency on there being a global variable set on its behalf by the top-level pipeline code, making it difficult to “locally reason” about the behavior of a node simply by reading its code.
Whenever possible, nodes should “late bind” environment variables: accepting a compile-time / runtime flowey parameter, and then setting it prior to executing a child command that requires it.
Only use this API in exceptional cases, such as obtaining an environment variable whose value is determined by a job-level GitHub Actions expression evaluation.
Sourcepub fn gh_grant_permissions<N: FlowNodeBase + 'static>(
self,
permissions: impl IntoIterator<Item = (GhPermission, GhPermissionValue)>,
) -> Self
pub fn gh_grant_permissions<N: FlowNodeBase + 'static>( self, permissions: impl IntoIterator<Item = (GhPermission, GhPermissionValue)>, ) -> Self
(GitHub Actions only) Grant permissions required by nodes in the job.
For a given node handle, grant the specified permissions.
The list provided must match the permissions specified within the node
using requires_permission
.
NOTE: While this method is called at a node-level for auditability, the emitted yaml grants permissions at the job-level.
This can lead to weird situations where node 1 might not specify a permission required according to Github Actions, but due to job-level granting of the permission by another node 2, the pipeline executes even though it wouldn’t if node 2 was removed.
For available permission scopes and their descriptions, see https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#permissions.
pub fn apply_patchfn(self, patchfn: PatchFn) -> Self
Sourcepub fn with_condition(self, cond: UseParameter<bool>) -> Self
pub fn with_condition(self, cond: UseParameter<bool>) -> Self
Only run the job if the specified condition is true.
When running locally, the cond
’s default value will be used to
determine if the job will be run.
Sourcepub fn dep_on<R: IntoRequest + 'static>(
self,
f: impl FnOnce(&mut PipelineJobCtx<'_>) -> R,
) -> Self
pub fn dep_on<R: IntoRequest + 'static>( self, f: impl FnOnce(&mut PipelineJobCtx<'_>) -> R, ) -> Self
Add a flow node which will be run as part of the job.
Sourcepub fn finish(self) -> PipelineJobHandle
pub fn finish(self) -> PipelineJobHandle
Finish describing the pipeline job.
Sourcepub fn get_platform(&self) -> FlowPlatform
pub fn get_platform(&self) -> FlowPlatform
Return the job’s platform.