Previous answers are correct but here is one more way of doing this and some tips:
Option #1
Go to you Jenkins job and search for "add build step" and then just copy and paste your script there
Option #2
Go to Jenkins and do the same again "add build step" but this time put the fully qualified path for your script in there example : ./usr/somewhere/helloWorld.sh
things to watch for /tips:
- Environment variables, if your job is running at the same time then you need to worry about concurrency issues. One job may be setting the value of environment variables and the next may use the value or take some action based on that incorrectly.
- Make sure all paths are fully qualified
- Think about logging /var/log or somewhere so you would also have something to go to on the server (optional)
- thing about space issue and permissions, running out of space and permission issues are very common in linux environment
- Alerting and make sure your script/job fails the jenkin jobs when your script fails