Can Jenkins run a shell script located outside of the Jenkins workspace

Jenkins

Can Jenkins run a shell script located outside of the Jenkins workspace? I am wondering if I can get Jenkins to run scripts outside of the Jenkins workspace that are not sourced within any kind of source control repository.

Does Jenkins have a plugin that allows adding a build step that points to a arbitrary located script file on the same system?

Best Answer

In Jenkins there is a Build step to 'Execute Shell'. You shouldn't need an additional plug in. I use that step to run commands. The command needs to be Full Path or with relative to the workspace directory. Depending on the type of project you are using. It might be a Pre-Build step or Post-Build Step.

ie: for applications

curl http://google.com

or scripts

/app/path/script.sh
../script.sh