RE: Re: Re: Re: example using application_java?


#1

My ears are all perked up on this one!!

-Todd


From: Andrea Campi [mailto:andrea.campi@zephirworks.com]
Sent: Wed 5/30/2012 12:03 AM
To: chef@lists.opscode.com
Subject: [chef] Re: Re: Re: example using application_java?

On Wed, May 30, 2012 at 12:37 AM, Jesse Campbell hikeit@gmail.com wrote:

We deploy our rails apps in war/java containers using something called
Warbler (this comes from the developers, I haven’t investigated it
myself). The dev group wants us to implement capistrano, but i feel
like that is like saying we should use puppet for this one thing…
we’re a chef shop, do it the chef way is how I want to respond… but
so far I haven’t found what i need.
We may continue using Bryan’s tomcat6, and use his maven LWRP for
deploying the wars… but i think even that may leave us without a
migrations plan…
perhaps there is a way to use some aspects of the deploy resource to
orchestrate migrations… i’ll investigate later in the week (for now
I just need to get things running once to get the PMs off my back).

For a quick and dirty fix, you could try subscribing to the
java_remote_file resource.
I haven’t actually tried this so YMMV, but it should be doable.

I’d start with something like this:

assuming you have a:

application “app-test” do

end

then in your recipe add something like:

execute “migrate app-test” do
command “rake db:migrate” # or whatever shell command you need to run
action :nothing
subscribes :run, resources(:java_remote_file => “app-test”)
end

Maybe it will work on the first attempt :slight_smile:
If it won’t, run it with chef-client -l debug and email me the log
(private email) and I’ll walk you through the rest.
Once we get you set up, I’ll document it for the next poor soul.

Andrea