What is the directory structure of a shared library?
BeginnerConceptShared libraries
Answer
shack-lib/
├── vars/
│ ├── kanikoBuild.groovy # global step: kanikoBuild(...)
│ └── kanikoBuild.txt # help text shown in Global Variables Reference
├── src/
│ └── com/devopsshack/
│ └── ImageTag.groovy # class: com.devopsshack.ImageTag
├── resources/
│ └── pods/node-build.yaml # loaded with libraryResource
└── test/ # JenkinsPipelineUnit tests
At least one of vars/ or src/ must exist.
More on Shared libraries
How does a `vars/` global step work?BeginnerWhat goes in `src/` and how is it used?IntermediateHow do classes in `src/` call pipeline steps?IntermediateWhat is `libraryResource` used for?IntermediateWhat are the ways to load a library in a Jenkinsfile?IntermediateGlobal vs folder-level vs ad hoc libraries: what is the security difference?Advanced