How do I have to execute a managed script in a Jenkins pipeline How do I have to execute a managed script in a Jenkins pipeline jenkins jenkins

How do I have to execute a managed script in a Jenkins pipeline


I used to use the Scriptler plugin, however it had security issues raised against it.

When I moved all my stuff from freestyle builds to pipelines (expressed in Groovy) in 2017/8 I migrated that functionality to Shared Libraries (as an aside: right place to put code that runs against the Jenkins object model).

All paths in a Jenkins job (freestyle or pipeline) are %JENKINS_WORKSPACE% relative. Jenkins does not natively like you going above this directory on the filesystem.

I would highly recommend all the stuff your build process needs be in the primary Jenkins workspace (preferably via a git checkout or a shared library). Versioning everything in git will always be your friend. If this is not what you want to do, other options could be:

  1. Shared Workspace
  2. This post