Skip to main content

Job

Struct Job 

Source
pub struct Job {
Show 23 fields pub stage: Option<String>, pub image: Option<Image>, pub script: Option<Vec<String>>, pub before_script: Option<Vec<String>>, pub after_script: Option<Vec<String>>, pub when: Option<String>, pub allow_failure: Option<bool>, pub services: Option<Vec<Service>>, pub tags: Option<Vec<String>>, pub variables: Option<HashMap<String, String>>, pub dependencies: Option<Vec<String>>, pub artifacts: Option<Artifacts>, pub cache: Option<Cache>, pub rules: Option<Vec<Rule>>, pub only: Option<Only>, pub except: Option<Except>, pub retry: Option<Retry>, pub timeout: Option<String>, pub parallel: Option<usize>, pub template: Option<bool>, pub extends: Option<Vec<String>>, pub needs: Option<Value>, pub interruptible: Option<bool>,
}
Expand description

A job in a GitLab CI/CD pipeline

Fields§

§stage: Option<String>

The stage this job belongs to

§image: Option<Image>

Docker image to use for this job

§script: Option<Vec<String>>

Script commands to run

§before_script: Option<Vec<String>>

Commands to run before the main script

§after_script: Option<Vec<String>>

Commands to run after the main script

§when: Option<String>

When to run the job (on_success, on_failure, always, manual)

§allow_failure: Option<bool>

Allow job failure

§services: Option<Vec<Service>>

Services to run alongside the job

§tags: Option<Vec<String>>

Tags to define which runners can execute this job

§variables: Option<HashMap<String, String>>

Job-specific variables

§dependencies: Option<Vec<String>>

Job dependencies

§artifacts: Option<Artifacts>

Artifacts to store after job execution

§cache: Option<Cache>

Cache configuration

§rules: Option<Vec<Rule>>

Rules for when this job should run

§only: Option<Only>

Only run on specified refs

§except: Option<Except>

Exclude specified refs

§retry: Option<Retry>

Retry configuration

§timeout: Option<String>

Timeout for the job in seconds

§parallel: Option<usize>

Mark job as parallel and specify instance count

§template: Option<bool>

Flag to indicate this is a template job

§extends: Option<Vec<String>>

List of jobs this job extends from

§needs: Option<Value>

Job needs (dependencies with more granular control)

§interruptible: Option<bool>

Whether the job can be interrupted by a newer pipeline

Trait Implementations§

Source§

impl Clone for Job

Source§

fn clone(&self) -> Job

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Job

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for Job

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Serialize for Job

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

§

impl Freeze for Job

§

impl RefUnwindSafe for Job

§

impl Send for Job

§

impl Sync for Job

§

impl Unpin for Job

§

impl UnsafeUnpin for Job

§

impl UnwindSafe for Job

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.