Pipeline concepts
The following concepts are key aspects of Jenkins Pipeline, which tie in closely to Pipeline syntax (see the overview below).
Pipeline
A Pipeline is a user-defined model of a CD pipeline. A Pipeline’s code defines your entire build process, which typically includes stages for building an application, testing it and then delivering it.
Also, a pipeline
block is a key part of Declarative Pipeline syntax.
Node
A node is a machine which is part of the Jenkins environment and is capable of executing a Pipeline.
Also, a node
block is a key part of Scripted Pipeline syntax.
Stage
A stage
block defines a conceptually distinct subset of tasks performed through the entire Pipeline (e.g. "Build", "Test" and "Deploy" stages), which is used by many plugins to visualize or present Jenkins Pipeline status/progress. [6]
Step
A single task. Fundamentally, a step tells Jenkins what to do at a particular point in time (or "step" in the process). For example, to execute the shell command make
use the sh
step: sh 'make'
. When a plugin extends the Pipeline DSL, [1] that typically means the plugin has implemented a new step.
DevOps Related Posts
Pipeline syntax overview
The following Pipeline code skeletons illustrate the fundamental differences between Declarative Pipeline syntax and Scripted Pipeline syntax.
Be aware that both stages and steps (above) are common elements of both Declarative and Scripted Pipeline syntax.
Declarative Pipeline fundamentals
In Declarative Pipeline syntax, the pipeline
block defines all the work done throughout your entire Pipeline.
pipeline {
agent any
stages {
stage('Build') {
steps {
//
}
}
stage('Test') {
steps {
//
}
}
stage('Deploy') {
steps {
//
}
}
}
}
Execute this Pipeline or any of its stages, on any available agent. | |
Defines the "Build" stage. | |
Perform some steps related to the "Build" stage. | |
Defines the "Test" stage. | |
Perform some steps related to the "Test" stage. | |
Defines the "Deploy" stage. | |
Perform some steps related to the "Deploy" stage DevOps Related Posts |
No comments:
Post a Comment