Which of the following best describes the primary purpose of the Jenkins Credentials plugin?
Think about what 'credentials' usually mean in software tools.
The Jenkins Credentials plugin is designed to securely store secrets such as passwords, SSH keys, and tokens. This allows Jenkins jobs to access sensitive data without exposing it in job configurations.
What is the expected output when running the Jenkins CLI command to list credentials in a domain with no credentials stored?
java -jar jenkins-cli.jar -s http://jenkins.example.com/ list-credentials system::system::jenkins _
Consider how an empty list might be represented in command output.
The Jenkins CLI returns an empty JSON array '[]' when no credentials exist in the specified domain.
Which Jenkinsfile snippet correctly uses the Credentials plugin to access a secret text credential with ID 'my-secret'?
pipeline {
agent any
stages {
stage('Use Secret') {
steps {
// Fill in the correct credentials usage
}
}
}
}Look for the correct syntax of the withCredentials step for secret text.
The withCredentials step requires a list of bindings. For secret text, use string(credentialsId: 'id', variable: 'VAR'). Other options are invalid syntax or do not exist.
A Jenkins pipeline fails with the error: java.lang.IllegalArgumentException: No credentials found with id 'db-password'. Which is the most likely cause?
Think about what 'No credentials found with id' means in Jenkins context.
This error usually means the credential ID is missing or the job does not have permission to access it. Network or plugin version issues do not cause this specific error.
Arrange the steps in the correct order to securely use a username and password credential in a Jenkins pipeline.
Think about the logical flow from setup to usage.
First, the credential must exist in Jenkins. Then the Jenkinsfile references it. Next, the pipeline uses the injected variables. Finally, the job runs and accesses the secret securely.