Jenkins uses agents (or nodes) to run jobs. What is the main risk if agents are not set up properly?
Think about what happens if the machine running the job does not have the right software installed.
If agents lack required tools or have wrong environment variables, jobs can fail or behave unpredictably. Proper setup ensures smooth and reliable job execution.
Given the command java -jar jenkins-cli.jar -s http://localhost:8080 list-jobs, what will it output if Jenkins has three jobs named 'BuildApp', 'TestApp', and 'DeployApp'?
java -jar jenkins-cli.jar -s http://localhost:8080 list-jobsThe command lists job names line by line.
The list-jobs command outputs each job name on a separate line.
Consider this Jenkinsfile snippet:
pipeline {
agent any
stages {
stage('Build') {
steps {
sh 'make build'
}
}
}
}The build fails with error: sh: 1: make: not found. What is the most likely cause?
Check if the command 'make' is available on the machine running the job.
The error means the shell cannot find the 'make' command. This usually happens if the agent machine lacks the tool or its PATH is not set correctly.
Arrange these steps in the correct order to set up a Jenkins pipeline for a new software project:
Think about what credentials are needed before Jenkins can access the code, and when the Jenkinsfile is created.
First, configure credentials so Jenkins can access the repository. Then create the Jenkinsfile defining the pipeline. Next, create the pipeline job in Jenkins linking to the repo. Finally, test by running a build.
Among these options, which practice most improves the reliability of Jenkins builds in a team environment?
Consider how isolation and environment consistency affect build results.
Dedicated agents with required tools and clean workspaces prevent interference between builds and ensure consistent environments, improving reliability.