Using Jenkins to Manage Scripts
Jump to navigation
Jump to search
- Build executers is basically servers
- You can run scripts
- A build in this context is basically when a script has been run
- It can tell you how long it took to run, how often it has been run
- You can give permissions to different tasks
- You can chain together builds
- For example, you can have one script that gets a database dump and another that uploads the database to a staging site
- Drupal.org uses Execute shell all the time, the other options are more Java scecific
- Archive artifacts means that builds will keep files that are generated in a build
- It can notify you when something breaks (email, irc, jabber, etc.)
- You can run it locally, but it's a little overkill if you are just using it for yourself. It really becomes awesome when you're working with a team.
- You can also include files (or whole git repos) and then run the scripts out of there instead of typing them directly into Jenkins
Example code:
[ -d DIRECTORYNAME] || git clone --branch -master http:/git.xxx
cd DIRECTORYNAME
git pull
$ run the command you want in the directory
- All of drupal.org scripts are available: http://drupalcode.org/project/infrastructure.git/tree/refs/heads/master
- You can have parameters for your build tasks that your scripts can use
- For bash scripts, the status of the scripts is the last thing that got called. So if you want it to return successfully end it with
exit 0