0
0
Jenkinsdevops~10 mins

Agent types (permanent, cloud) in Jenkins - Interactive Code Practice

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

Complete the code to define a permanent Jenkins agent node.

Jenkins
node('[1]') {
    echo 'Running on a permanent agent'
}
Drag options to blanks, or click blank then click option'
Atemporary
Bpermanent
Ccloud
Dephemeral
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'cloud' label for permanent agents
Using 'temporary' which is not a standard label
2fill in blank
medium

Complete the code to launch a cloud agent using the Jenkins pipeline.

Jenkins
podTemplate(label: '[1]') {
    node('[1]') {
        echo 'Running on a cloud agent'
    }
}
Drag options to blanks, or click blank then click option'
Acloud
Bpermanent
Clocal
Dmaster
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'permanent' label for cloud agents
Using 'master' which refers to the Jenkins controller
3fill in blank
hard

Fix the error in the Jenkins pipeline code to correctly use a permanent agent.

Jenkins
pipeline {
    agent {
        [1] 'permanent'
    }
    stages {
        stage('Build') {
            steps {
                echo 'Building on permanent agent'
            }
        }
    }
}
Drag options to blanks, or click blank then click option'
Anode
Bany
Cagent
Dlabel
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'node' which is for scripted pipelines
Using 'any' which means any available agent
4fill in blank
hard

Fill both blanks to define a cloud agent pod template with a label and container.

Jenkins
podTemplate(label: '[1]', containers: [containerTemplate(name: '[2]', image: 'jenkins/inbound-agent')]) {
    node('[1]') {
        echo 'Running in cloud agent container'
    }
}
Drag options to blanks, or click blank then click option'
Acloud
Bagent
Cjnlp
Dpermanent
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'permanent' label for cloud agents
Using wrong container names like 'agent'
5fill in blank
hard

Fill all three blanks to configure a permanent agent with a custom workspace and label.

Jenkins
node(label: '[1]', customWorkspace: '[2]') {
    stage('Test') {
        echo 'Running on [3] agent with custom workspace'
    }
}
Drag options to blanks, or click blank then click option'
Apermanent
B/home/jenkins/workspace
Dcloud
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'cloud' label for permanent agents
Incorrect workspace path format