Complete the code to define a stage in a Jenkins pipeline.
stage('[1]') { steps { echo 'Building...' } }
The stage block names a step in the pipeline flow, like 'Build'.
Complete the code to add a stage that runs tests.
stage('[1]') { steps { echo 'Running tests...' } }
The stage named 'Test' clearly shows this part runs tests in the pipeline.
Fix the error in the stage declaration by completing the blank.
stage([1]) { steps { echo 'Deploying...' } }
The stage name must be a string in quotes, like 'Deploy'.
Fill both blanks to create a stage named 'Build' with a step that echoes 'Compiling...'.
stage([1]) { steps { echo [2] } }
The stage name is 'Build' and the echo message is 'Compiling...'.
Fill all three blanks to define a pipeline with an agent, a 'Test' stage, and an echo step 'Running tests...'.
pipeline {
agent [1]
stages {
stage([2]) {
steps {
echo [3]
}
}
}
}The agent is 'any' to run on any available machine, the stage is 'Test', and the echo message is 'Running tests...'.
