Wiki source code of Automating Application Deployment From Jenkins or Hudson
Version 53.1 by Pascal Robert on 2012/05/29 07:54
Show last authors
| author | version | line-number | content |
|---|---|---|---|
| 1 | With the combination of the [[Jenkins>>http://jenkins-ci.org/]] or [[Hudson>>http://hudson-ci.org/]] continuous integration server and the REST Routes and Direct Actions that have been added to [[Wonder's JavaMonitor>>Wonder JavaMonitor and wotaskd]] you can automatically deploy from Hudson directly to your app servers | ||
| 2 | |||
| 3 | Included as an attachment to this page is a small Perl script that I demonstrated at WOWODC 2010. This script will take a build out of Hudson and deploy it to your wotaskd/JavaMonitor server. It will also add the app and create an instance if the app is not found in wotaskd. | ||
| 4 | |||
| 5 | You need to: | ||
| 6 | |||
| 7 | 1. Install a few CPAN Modules on your Hudson host | ||
| 8 | |||
| 9 | {{code title="Required CPAN Modules"}} | ||
| 10 | |||
| 11 | perl -MCPAN -e 'install Math::Pari' | ||
| 12 | perl -MCPAN -e 'install REST::Client' | ||
| 13 | perl -MCPAN -e 'install JSON' | ||
| 14 | perl -MCPAN -e 'install File::Rsync' | ||
| 15 | perl -MCPAN -e 'install Net::SSH::Perl' | ||
| 16 | |||
| 17 | {{/code}} | ||
| 18 | |||
| 19 | Installing Net::SSH::Perl on Ubuntu is a bit of a pig. I found these [[instructions>>http://www.csclug.org/?q=node/128]] helpful. | ||
| 20 | \\\\On CentOS, you will have to install the **openssl-devel** package. You will also need to install the **perl-CPAN** package (//yum install perl-CPAN//). | ||
| 21 | |||
| 22 | 1. Install the [[wodeploy.pl>>https://github.com/wocommunity/Deployment-Tools/tree/master/WODeploy]] script on your Jenkins host | ||
| 23 | 1. Install the Hudson [[Batch Tasks Plugin>>http://wiki.hudson-ci.org//display/HUDSON/Batch+Task+Plugin]] using Jenkins' built-in Plugin Manager (**Manage Jenkins** > **Manage Plugins**) | ||
| 24 | 1. In your Jenkins job, create a new Batch Task with the following call: | ||
| 25 | |||
| 26 | {{code title="Add This as a Batch Task to your Hudson Job"}} | ||
| 27 | |||
| 28 | /path/to/wodeploy.pl -U http://your.womonitorserver.com:56789/cgi-bin/WebObjects/JavaMonitor.woa -n ${DEPLOYED_APPLICATION_NAME} -P ${WORKSPACE}/Projects/${PROJECT_NAME}/dist/${DEPLOYED_APPLICATION_NAME}.woa -W ${WORKSPACE}/Projects/${PROJECT_NAME}/dist/Split/WebObjects/${DEPLOYED_APPLICATION_NAME}.woa -p yourMonitorPassword | ||
| 29 | |||
| 30 | {{/code}} |