I appreciate everyone's input so far.
Seth, I totally missed the application cookbook. I'll look into that and hopefully can get at least 1 piece running with Chef!
I love the premise, but all of the configuration management systems seem to have a bit of a steep climb before it becomes easy and powerful. :)
Thanks again.
-Matt
On Jun 21, 2011, at 12:10 AM, Seth Chisamore wrote:
The java_webapp recipe in the application cookbook [0][1] was created to accomplish just this task!
The Java Quick Start [1] has a full working example of using this recipe to deploy a Java webapp, including setting up an environment specific context.xml with database connection information.
Seth -- Opscode, Inc. Seth Chisamore, Senior Technical Evangelist IRC, Skype, Twitter, Github: schisamo
[2] http://help.opscode.com/kb/otherhelp/build-a-java-web-stack
On Mon, Jun 20, 2011 at 11:35 PM, Ken Mazaika <
">
> wrote:
could you use something like capistrano for java?On Mon, Jun 20, 2011 at 11:32 PM, Edward Sargisson <
" target="_blank">
> wrote:
I need to do the same thing but haven't written it yet. Here's my plan
- hopefully others can critique.
Firstly, you don't want to stop tomcat. Chef runs every 20 minutes or
so (or whenever you set it for) so it would stop your server every 20
minutes. Instead, you should work out if the file on your file server
has changed and then do the update. In my case, my build artifacts
have a build id. I plan to store the desired build id in a data bag *.
The deployed data bag goes into the node data. Then, on the chef run
it can compare and then run the update if required.
When you do the update you don't need to stop tomcat. Instead you
download the WAR to a temp directory then go to the webapps dir and
delete the directory for your webapp as well as the old WAR. Then you
copy the WAR in. (You can't download directly because then Tomcat
un-jars it before it's downloaded). Tomcat then un-jars it and starts
it up for you.
Cheers,
Edward
* Amusingly, I forgot the name for data bag and my mind came up with
drop bag. Once a trail runner, always a trail runner... :-)
On Mon, Jun 20, 2011 at 8:25 PM, <
" target="_blank">
> wrote:
> Hi everyone,
> I'm fairly new to Chef. I downloaded and deployed the tomcat cookbook to a
> node, and now I'm trying to add a recipe? or another cookbook, I'm not sure
> really...to deploy our web app that should run on Tomcat.
>
> I basically want the node to stop tomcat, delete everything in the webapps
> directory, and scp a file to the right spot..then start tomcat.
>
> I looked briefly at the deploy resource, but that's from a version control
> system...we don't keep builds in version control, only the source..the binary
> builds are on a server, so I don't think that's what I want.
>
> If anyone can point me in the right direction to get this going, that would be
> greatly appreciated.
>
> Thanks.
>
> -Matt
>
|