Reputation: 3136
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
Upvotes: 3
Views: 22315
Reputation: 41268
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
.
Upvotes: 3
Reputation: 1073
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.
Upvotes: 6