Wiki source code of Automating Application Deployment From Jenkins or Hudson
Version 52.1 by Pascal Robert on 2012/05/29 07:46
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 | |||
13 | perl -MCPAN -e 'install REST::Client' | ||
14 | perl -MCPAN -e 'install JSON' | ||
15 | perl -MCPAN -e 'install File::Rsync' | ||
16 | perl -MCPAN -e 'install Net::SSH::Perl' | ||
17 | |||
18 | {{/code}} | ||
19 | |||
20 | Installing Net::SSH::Perl on Ubuntu is a bit of a pig. I found these [[instructions>>http://www.csclug.org/?q=node/128]] helpful. | ||
21 | \\\\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//). | ||
22 | |||
23 | 1. Install the [[wodeploy.pl>>https://github.com/wocommunity/Deployment-Tools/tree/master/WODeploy]] script on your Jenkins host | ||
24 | 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**) | ||
25 | 1. In your Jenkins job, create a new Batch Task with the following call: | ||
26 | |||
27 | {{code title="Add This as a Batch Task to your Hudson Job"}} | ||
28 | |||
29 | /path/to/wodeploy.pl -U http://your.womonitorserver.com:56789/cgi-bin/WebObjects/JavaMonitor.woa -n ${APPLICATION_NAME} -P ${WORKSPACE}/Projects/${PROJECT_NAME}/dist/${APPLICATION_NAME}.woa -W ${WORKSPACE}/Projects/${PROJECT_NAME}/dist/Split/WebObjects/${APPLICATION_NAME}.woa -p yourMonitorPassword | ||
30 | |||
31 | {{/code}} |