1.

How to create & use a Shared Library in Jenkins?

Answer»

Basic requirements for a Jenkins shared library to be used in a Pipeline CODE are -

  • A REPOSITORY with pipeline shared library code in SCM.
  • An appropriate SCM Plugin configuration for the Jenkins instance.
  • Global Shared Library should be CONFIGURED in Jenkins Global configuration.
  • Include the Shared Library in the Pipeline Code and use the methods defined in the Jenkins Shared Library.

E.g.

#!/urs/bin/env groovy
@Library('fs_jenkins_shared_library@v2.0.7')_



Discussion

No Comment Found