Shared Libraries
Libraries are an extension of external job libraries. They are mainly used to maintain a central repository of organization-approved libraries/packages to be used across multiple Jobs or Data labs.
Files that need to be uploaded to a shared library must be specified as a list of items under the Artifacts key.
Each file path should be relative to the root resources directory.
Below is the sample resource definition file for Library:
{
"rLibrary": {
"Type": "SharedLibraries",
"Artifacts": {
"Library": [
"resources/shared-libraries/libraries.py"
]
},
"Properties": {
"LibraryName": "cicd_library",
"LibraryDescription": "Library created using CICD",
"Packages": []
}
}
}
SharedLibraries lists no other resource types under DependsOn in the CICD module configuration.
Dependent resources should not be deleted before the primary resource; attempting to do so may lead to failures or inconsistencies during the deletion process.
Referencing this Resource
Below are the common keys that can be used in the DependsOn function to retrieve details of this resource.
Supported Keys
| Key | Description |
|---|---|
| LibraryName | Returns the LibraryName value of this resource |
| LibraryId | Returns the LibraryId value of this resource |
For additional supported keys, refer to the API definition document for the respective resource type.
Example
The following example shows how to retrieve the shared library name from a shared library template and use it in a job template:
{
"rPythonJob": {
"Type": "Job",
"Properties": {
"SharedLibraries": [
{
"!DependsOn": "rLibrary.LibraryId"
}
]
}
}
}