[chef] Re: Newb Question on Deploy Resource


Chronological Thread 
  • From: Graham Christensen < >
  • To:
  • Subject: [chef] Re: Newb Question on Deploy Resource
  • Date: Tue, 12 Mar 2013 23:12:28 -0400

Hi David,

When using the timestamp deploy mechanism (putting the releases in a structure like this:  /my/path/releases/20130313024211) it prevents Chef from being idempotent.

Try switching to the deploy_revision strategy.

Graham

-- 
Graham Christensen

On Tuesday, March 12, 2013 at 10:54 PM, wrote:

Sorry if this is a totally dumb question, but I can't seem to find the answer
out there. I was hoping to try and leverage the deploy resource for a simple
app I've got in git. I've been through the docs at
http://docs.opscode.com/resource_deploy.html and I have things working for the
most part.

The question I have is about expected behavior. It appears that every single
chef run the resource is taking action (including restarting the app) despite
the fact that no changes are pushed to the github repo. We run Chef client on a
schedule, so I'd hate to have the app "deployed" every time chef runs.

So my question is if this is expected or am I doing something wrong? On the
surface this sure doesn't feel very idempotent, and given the general push to
ensure resources are idempotent this caught me a little of guard.

Here is the uber basic recipe:
deploy "/my/path" do
repo "git://my_git/my_org/my_app.git"
migrate false
symlink_before_migrate({})
restart_command "service httpd restart"
end

Log Entries:
INFO: Processing deploy[/my/path] action deploy (cookbook::default line 15)
INFO: deploy[/my/path] copied the cached checkout to
/my/path/releases/20130313024211
INFO: deploy[/my/path] made pre-migration symlinks
INFO: deploy[/my/path] purged directories in checkout log, tmp/pids,
public/system
INFO: deploy[/my/path] created directories before symlinking tmp,public,config
INFO: deploy[/my/path] linked shared paths into current release: system =>
public/system, pids => tmp/pids, log => log
INFO: deploy[/my/path] made pre-migration symlinks
INFO: deploy[/my/path] linked release /my/path/releases/20130313024211 into
production at /my/path/current
INFO: deploy[/my/path] updated symlinks
INFO: deploy[/my/path] restarting app
INFO: deploy[/my/path] removing old release /my/path/releases/20130313022329
INFO: deploy[/my/path] deployed to /my/path




Archive powered by MHonArc 2.6.16.

§