Condition

Condition is the 'when' you want to update

Description

The "condition" stage test based on a third "resource" like a file, an api, etc…​, if we can proceed the pipeline or if we must abort.

Parameters

NameRequiredDefaultDescription

kind

-

Define the resource type used for the spec

name

-

Small description used in message, reports, etc.

spec

-

Define resource parameters, cfr to appropriated documentation

Examples

# Source return v1.0.0

conditions:
  docker:
    name: "Docker Image Published on Registry"
    kind: dockerImage
    spec:
      image: "jenkinsciinfra/plugin-site-api"

# stop here because the condition doesn't pass

In this example, we use the dockerImage condition. According to its documentation, we are checking if the docker image 'jenkinsciinfra/plugin-site-api' with the tag 'v1.0.0' (returned from the source) exist on DockerHub. it’s not the case so it stop the pipeline here

Edit this page on GitHub