In Jenkins, a shared library has a specific directory structure. Which directory inside the library is used to store reusable Groovy scripts that can be called from Jenkins pipelines?
Think about where simple scripts or functions are placed for easy access in pipelines.
The vars directory contains Groovy scripts that define global variables or functions accessible directly in Jenkins pipelines.
You have a Jenkins shared library repository with the following structure:
src/org/example/Utils.groovy vars/build.groovy resources/config.yaml
What will be the output of the command ls vars when run in the root of the library?
Check which files are inside the vars folder.
The vars directory contains build.groovy. The other files are in different directories.
Arrange the steps in the correct order for how Jenkins loads a shared library during pipeline execution.
Think about configuration first, then fetching code, then loading, then usage.
Jenkins first reads the library config, clones the repo, loads scripts, then pipeline uses them.
A Jenkins pipeline fails with an error saying a function from the shared library is not found. The shared library has the correct directory structure and is configured properly. What is the most likely cause?
Consider how code in 'src' is accessed differently than code in 'vars'.
Scripts in 'src' require explicit import statements in the pipeline. If missing, functions won't be found.
Which is the best practice for storing configuration files like YAML or JSON in a Jenkins shared library to be used by pipeline scripts?
Think about separation of code and static resources in Jenkins libraries.
The 'resources' directory is designed to hold static files like configs, which can be loaded easily by pipelines.