Calling a Shared Library script


To call a Shared Library script, that is, to execute its call method, you:

  • Use @Library annotation to tell Jenkins to use a certain Shared Library
  • Follow the library name with the version (branch) to use
  • Specify a list of methods to import (or use '_' to import all methods)
  • Code the name of the script file
@Library('<library_name>@<branch>') _
...
<script_file_name>

So, for the examples here, in most cases, that would be:

@Library('Shared_Lib@master') _

<script_file_name> (
    ispwStream:        ISPW_Stream,
    ispwApplication:   ISPW_Application,
    ispwRelease:       ISPW_Release,
    ispwAssignment:    ISPW_Assignment,
    ispwSet:           ISPW_Set_Id,
    ispwSrcLevel:      ISPW_Src_Level,
    ispwOwner:         ISPW_Owner,
    cesToken:          'xxxx',            
    jenkinsCesToken:   'xxxx',
    hciConnectionId:   'xxxx',
    hciToken:          'xxxx',
    ccRepository:      'xxxx',
    gitProject:        'cpwr-devops',
    gitCredentials:    'xxxx'
)

 

Tip: For faster searching, add an asterisk to the end of your partial query. Example: cert*

BMC AMI DevX Mainframe DevOps