0
0
Jenkinsdevops~10 mins

Why stages organize pipeline flow in Jenkins - Test Your Understanding

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to define a stage in a Jenkins pipeline.

Jenkins
stage('[1]') {
    steps {
        echo 'Building...'
    }
}
Drag options to blanks, or click blank then click option'
Asteps
BBuild
Cpipeline
Dagent
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'steps' or 'agent' as the stage name.
2fill in blank
medium

Complete the code to add a stage that runs tests.

Jenkins
stage('[1]') {
    steps {
        echo 'Running tests...'
    }
}
Drag options to blanks, or click blank then click option'
ADeploy
BCleanup
CBuild
DTest
Attempts:
3 left
💡 Hint
Common Mistakes
Naming the test stage as 'Deploy' or 'Build'.
3fill in blank
hard

Fix the error in the stage declaration by completing the blank.

Jenkins
stage([1]) {
    steps {
        echo 'Deploying...'
    }
}
Drag options to blanks, or click blank then click option'
A'Deploy'
BDeploy
C"Deploy"
Ddeploy
Attempts:
3 left
💡 Hint
Common Mistakes
Leaving out quotes causes syntax errors.
4fill in blank
hard

Fill both blanks to create a stage named 'Build' with a step that echoes 'Compiling...'.

Jenkins
stage([1]) {
    steps {
        echo [2]
    }
}
Drag options to blanks, or click blank then click option'
A'Build'
B'Compiling...'
C'Testing...'
D'Deploying...'
Attempts:
3 left
💡 Hint
Common Mistakes
Mixing stage name and echo message.
5fill in blank
hard

Fill all three blanks to define a pipeline with an agent, a 'Test' stage, and an echo step 'Running tests...'.

Jenkins
pipeline {
    agent [1]
    stages {
        stage([2]) {
            steps {
                echo [3]
            }
        }
    }
}
Drag options to blanks, or click blank then click option'
Aany
B'Test'
C'Running tests...'
D'Build'
Attempts:
3 left
💡 Hint
Common Mistakes
Using wrong agent name or missing quotes.