pipeline
is a customizable working model that defines an entire process for delivering software. In general, it includes build, test, and deployment phases.stage
of executing a pipeline
. It must appear in the top grid of a descriptive file
or at every stage
.Required? | Yes |
Parameter list | See below |
Permitted location | Must appear in the top grid of a descriptive file or at every stage |
stage
defines a series of closely related steps
. Each stage
, such as the "build stage", the "test stage", or the "deployment stage", undertakes an independent, clear responsibility in an entire pipeline. Generally, all actual build processes are provided in stages.Required? | At least one |
Parameter list | A required string parameter that specifies the name of a stage |
Permitted location | In the stage block |
stage list
includes a series of stages
. A stage list
will include at least one stage
. A pipeline
must have and only have one stage list
.Required? | Yes |
Parameter list | None |
Permitted location | Can only appear once in the pipeline |
step list
describes what to do at a stage
and what specific commands to run. For example, a step
needs the system to print a "Building" message and run the command echo 'building...'
.Required? | Yes |
Parameter list | None |
Permitted location | In every stage block |
stages
executed in parallel to accelerate the execution speed, especially when a stage
and another stage
are independent of each other. Take note that you cannot set the execution environment
for any stage
with a parallel
block.pipeline {agent anystages {stage('check out') {steps {sh 'ci-init'checkout([$class: 'GitSCM', branches: [[name: env.GIT_BUILD_REF]],userRemoteConfigs: [[url: env.GIT_REPO_URL]]])}}stage('build') {steps {echo 'building...'sh 'make'echo 'build complete.'}}stage('Test') {steps {echo 'unit testing...'sh 'make check'junit 'reports/**/*.xml'echo 'unit testing complete.'}}stage('deploy') {steps {echo 'deploying...'sh 'make publish'echo 'deployment complete'}}}}
Was this page helpful?