Complete the code to define a stage named 'Build' in a Jenkins pipeline.
stage('[1]') { steps { echo 'Building...' } }
The stage block defines a named phase in the Jenkins pipeline. Here, the stage is named 'Build'.
Complete the code to add a 'Test' stage with a shell command step.
stage('Test') { steps { [1] 'echo Running tests' } }
bat on Linux agents.echo as a step instead of a command.The sh step runs shell commands on Unix-like agents in Jenkins pipelines.
Fix the error in the stage block by completing the missing keyword.
stage('Deploy') { [1] { echo 'Deploying application' } }
steps block.script instead of steps for simple commands.The steps block is required inside a stage to define the actions Jenkins should perform.
Fill both blanks to create a stage named 'Test' that runs a shell command.
stage('[1]') { [2] { sh 'echo Testing...' } }
script instead of steps for simple commands.The stage is named 'Test' and the commands go inside the steps block.
Fill all three blanks to define a 'Deploy' stage with an agent and a shell step.
stage('[1]') { agent { [2] 'any' } steps { [3] 'echo Deploying app' } }
node instead of label inside agent.bat on Linux agents.steps block.The stage is named 'Deploy'. The agent uses label to specify the node label. The sh step runs the shell command.