Which of the following best describes the purpose of the stage directive in a Jenkins Pipeline?
Think about how Jenkins shows progress in the pipeline view.
The stage directive groups related steps into named phases. This helps organize the pipeline and shows progress visually in Jenkins UI.
What is the output of the following Jenkins CLI command if the Jenkins server is running and the job build-app exists?
java -jar jenkins-cli.jar -s http://localhost:8080/ list-jobs
This command lists all jobs on the Jenkins server.
The list-jobs command outputs all job names configured on the Jenkins server. If build-app exists, it will appear in the list.
Given this Jenkins Pipeline snippet, what is the order of printed output?
pipeline {
agent any
stages {
stage('Build') {
steps {
echo 'Building...'
}
}
stage('Test') {
steps {
echo 'Testing...'
}
}
stage('Deploy') {
steps {
echo 'Deploying...'
}
}
}
}Stages run in the order they are defined.
Jenkins executes pipeline stages sequentially in the order they appear: Build, then Test, then Deploy.
A Jenkins freestyle job fails with the error: hudson.AbortException: script returned exit code 1. What is the most likely cause?
Exit code 1 usually means a command failed.
The error means the script or command run by the job ended with exit code 1, which signals failure. This causes Jenkins to abort the job.
Which Jenkins feature is the best practice to securely store and use sensitive information like passwords or API tokens in pipelines?
Think about how to keep secrets safe and not expose them in logs or code.
The Jenkins Credentials Plugin securely stores secrets and allows pipelines to access them safely without exposing sensitive data in code or logs.