4

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?

1

1 Answer 1

2

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
1
  • Lets say I want to run a maven project outside my workspace. The above answer wouldn't work without a 'change working directory' option and also jenkins wouldn't know how to find the junit results output of a job such as that. So, its problematic. I have't tried it yet but I am guessing there will be a few problems.
    – djangofan
    Dec 23, 2014 at 22:46

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .