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, < "> > 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
>
Archive powered by MHonArc 2.6.16.