Trait gitlab_runner::JobHandler
source · [−]pub trait JobHandler: Send {
fn step<'life0, 'life1, 'async_trait>(
&'life0 mut self,
script: &'life1 [String],
phase: Phase
) -> Pin<Box<dyn Future<Output = JobResult> + Send + 'async_trait>>
where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait;
fn upload_artifacts<'life0, 'life1, 'async_trait>(
&'life0 mut self,
_uploader: &'life1 mut Uploader
) -> Pin<Box<dyn Future<Output = JobResult> + Send + 'async_trait>>
where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
{ ... }
fn cleanup<'life0, 'async_trait>(
&'life0 mut self
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where
'life0: 'async_trait,
Self: 'async_trait,
{ ... }
}
Expand description
Async trait for handling a single Job
Note that this is an asynchronous trait which should be implemented by using the async_trait
crate. However this also means the rustdoc documentation is interesting…
Required Methods
Do a single step of a job
This gets called for each phase of the job (e.g. script and after_script). The passed string array is the same array as was passed for a given step in the job definition.cold
Note that gitlab concatinates the before_script
and script
arrays into a single
Phase::Script step
Provided Methods
Upload artifacts to gitlab
This gets called depending on whether the job definition calls for artifacts to be uploaded based on the result of the script run
Cleanup after the job is finished
This method always get called whether or not the job succeeded, allowing the job handler to clean up as necessary.