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
According what you tell I think the problem can be
sudo chmod 777 path_to_script/jake.sh./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.
A workaround for shell scripts can be to run the script as
bash ./jake.sh
instead of
./jake.sh
Then you don't have to do chmod. Useful when you wipe the workspace before every build.
In the same manner, if you have a nodejs shell script or python script, you can run node myscript.js / python myscript.py.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With