

Some example if clauses for workflow: rules: When no rules evaluate to true, the pipeline does not run. variables: If not defined, uses the variables defined elsewhere.To prevent pipelines from running, set to never.when: Specify what to do when the if rule evaluates to true.

if: Check this rule to determine when to run a pipeline.

You can use the workflow:rules templates to import Use workflow: to determine whether or not a pipeline is created.ĭefine this keyword at the top level, with a single rules: keyword that The rspec 2.7 job does not use the default, because it overrides the default with The following example sets the ruby:3.0 image as the default for all jobs in the pipeline. These job keywords can be defined inside a default: section: Of the listed keywords use the value defined in the default: section. You can set global defaults for some keywords. You can’t use these keywords as job names: Variables Define job variables on a job level. Trigger Defines a downstream pipeline trigger. Timeout Define a custom job-level timeout that takes precedence over the project-wide setting. Tags List of tags that are used to select a runner. Script Shell script that is executed by a runner. Rules List of conditions to evaluate and determine selected attributes of a job, and whether or not it’s created. Retry When and how many times a job can be auto-retried in case of a failure. Release Instructs the runner to generate a release object. Parallel How many instances of a job should be run in parallel. Pages Upload the result of a job to use with GitLab Pages. Needs Execute jobs earlier than the stage ordering. Interruptible Defines if a job can be canceled when made redundant by a newer run. Inherit Select which global defaults all jobs inherit.
#EXAMPLE README FILE GITHUB CODE#
A failed job does not cause the pipeline to fail.Īrtifacts List of files and directories to attach to a job on success.īefore_script Override a set of commands that are executed before job.Ĭache List of files that should be cached between subsequent runs.Ĭoverage Code coverage settings for a given job.ĭast_configuration Use configuration from DAST profiles on a job level.ĭependencies Restrict which artifacts are passed to a specific job by providing a list of jobs to fetch artifacts from.Įnvironment Name of an environment to which the job deploys.Įxcept Control when jobs are not created.Įxtends Configuration entries that this job inherits from. gitlab-ci.yml file, you can validate it with theĪ job is defined as a list of keywords that define the job’s behavior.Īfter_script Override a set of commands that are executed after job.Īllow_failure Allow job to fail. gitlab-ci.yml file used in an enterprise, see the.
