Complete the code to define a Jenkins pipeline stage named 'Build'.
stage('[1]') { steps { echo 'Building the project' } }
The stage block defines a phase in the Jenkins pipeline. Here, the stage is named 'Build'.
Complete the code to specify the node label 'linux' for running the pipeline.
node('[1]') { stage('Test') { steps { echo 'Running tests' } } }
The node block specifies the agent where the pipeline or stage runs. Here, it runs on a node labeled 'linux'.
Fix the error in the node block to correctly specify the agent.
node [1] { stage('Deploy') { steps { echo 'Deploying application' } } }
The node label must be a string inside quotes. Without quotes, Jenkins will throw a syntax error.
Fill both blanks to create a stage named 'Test' that runs on a node labeled 'windows'.
node([1]) { stage([2]) { steps { echo 'Running tests' } } }
The node block requires the node label as a quoted string. The stage block requires the stage name as a quoted string.
Fill all three blanks to create a pipeline that runs on a 'linux' node, has a stage named 'Build', and echoes 'Building project'.
node([1]) { stage([2]) { steps { echo [3] } } }
The node block uses the 'linux' label. The stage is named 'Build'. The echo command prints 'Building project' inside quotes.