Executing custom shell script to build in jenkins

jenkins

Solution

According what you tell I think the problem can be

- The script is not marked as a executable. In this case add in Build -> Execute Shell (in case you have linux) `sudo chmod 777 path_to_script/jake.sh`.

- The script is not in the base directory. Remembeber that when you execute a bash script, the current directory is `/path_to_job/workspace`. So you have first to move to the script folder (`cd path_to_script`) or specify the path when running it: `./path_to_script/jake.sh`.

I hope this solves your problem.

Problem

I have setup a jenkins job to build my project. I have a jake.sh file in my project and the code is pulled from github. I want "npm install" command to be executed and then jake.sh to be executed once the the code is checked out. How can I configure this in jenkins? I have tried givin ./jake.sh and jake.sh in Build->Execute Shell section

Original source