0
0
Jenkinsdevops~10 mins

Why distributed builds matter 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 start a Jenkins build on a remote agent.

Jenkins
node('[1]') {
    echo 'Building on remote agent'
}
Drag options to blanks, or click blank then click option'
Alocalhost
Bmaster
Cagent1
Ddocker
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'master' runs on the main Jenkins server, not distributed.
2fill in blank
medium

Complete the code to run a shell command on a distributed Jenkins agent.

Jenkins
node('agent1') {
    [1] 'echo Hello from distributed build'
}
Drag options to blanks, or click blank then click option'
Ash
Bcmd
Cpowershell
Dbat
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'bat' on a Linux agent causes errors.
3fill in blank
hard

Fix the error in the Jenkins pipeline to distribute builds correctly.

Jenkins
pipeline {
    agent [1] 
    stages {
        stage('Build') {
            steps {
                echo 'Building...'
            }
        }
    }
}
Drag options to blanks, or click blank then click option'
Aagent1
Bmaster
Cnone
Dany
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'none' disables agent allocation.
4fill in blank
hard

Fill both blanks to create a parallel distributed build on two agents.

Jenkins
parallel {
    build1: {
        node('[1]') {
            echo 'Build on first agent'
        }
    },
    build2: {
        node('[2]') {
            echo 'Build on second agent'
        }
    }
}
Drag options to blanks, or click blank then click option'
Aagent1
Bmaster
Cagent2
Dlocalhost
Attempts:
3 left
💡 Hint
Common Mistakes
Using the same agent name for both builds prevents true parallelism.
5fill in blank
hard

Fill all three blanks to define a distributed build with environment variables and shell steps.

Jenkins
node('[1]') {
    env.BUILD_ENV = '[2]'
    [3] 'echo Building in $BUILD_ENV on distributed agent'
}
Drag options to blanks, or click blank then click option'
Aagent3
Bproduction
Csh
Ddevelopment
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'development' instead of 'production' changes environment meaning.