- From: Brian Akins <
>
- To:
- Subject: [chef] Re: Re: Re: Re: Re: Re: Re: ideas on deploying java applications
- Date: Wed, 6 Oct 2010 11:02:37 -0400
FWIW, we do something extremely cheesy. The deploy resource is a little overkill for us.
We wrote a simple define that will sync a specific branch/tag from git and then run a script. But default, it will cwd to the directory of the git code and run "installme," but you can override this as well. We had to use the monkey patch that backports a fix to the git resource. So a git deploy can notify other resources correctly.
Is this ideal, no. But it's very simple: get stuff into a branch and we deploy it (I really don't care how it got to that branch). It works for java, ruby, php, C, etc.
Here's some pseudo chef:
define :git_deploy, :command => "./installme", :revision => "master" do
directory "/var/git" do
owner "root"
group "root"
mode "0755"
action :create
end
bash "build #{params[:name]}" do
user "root"
cwd "/var/git/#{params[:name]}"
action :nothing
code params[:command]
end
git "/var/git/#{params[:name]}" do
action :sync
repository params[:repository]
revision params[:revision]
depth 1
notifies :run, resources(:bash => "build #{params[:name]}"), :immediately
end
end
Archive powered by MHonArc 2.6.16.