2

Most of the time there's nothing new in the git repo that is deployed to a local directory, but if there are any changes, the node.js application should be restarted to start working with the latest changes. It should not be touched if no new code was pulled.

How to achieve that with chef?

1
  • Can't you use the git 'post-update' hook? Commented Dec 18, 2012 at 12:06

1 Answer 1

3

The git sync action actually triggers notifications if the revision has changed. So add an execute block that runs only on notification, and you're done!

git "/home/code" do ... action :sync notifies :run, "execute[restart-node-app]", :immediately end execute "restart-node-app" do command "..." action :nothing end 
1

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.