ruby - When does chef's deploy_revision/before_symlink run? -
I am trying to understand how and when the first match is run, especially if there is a failure this block Take:
deploy_revision "foo" work: deployment deploy_to "/ opt / foo" ... symlink_before_migrate (app_symlinks.merge ({...}) purge_before_symlink ([]) Create_dirs_before_symlink ([]) Symlinks ({}) before_symlink do current_release = release_path bash "foo_buildout_install" user "foo" cwd current_release code & lt; & Lt; -EOH ... EOH end times restart_command current_release = release_path bash "foo_foreman_install_and_restart" restart FU || Start EOH end and end << / code> Under the conditions, do the first_similink blocks have to be run? For example, if the build fails, then the chef is re-provisioned - will it run again? If the symlink is made then is it called again?
(I am still learning chef, and I do not develop ruby, so please assume that how I work deploy_revision, or rail deployment model.) < P>
I believe it 'deployed' every time, which I believe is that every time you make provisions through chefs.
If you want to do further research for yourself, then install Chef in your Ruby Gems route and ./ lib / chef / provider / deployed .rb < P> Deployment method too much: def deployment enforce_ownership verify_directories_exist update_cached_repo copy_cached_repo install_gems enforce_ownership callback migrate callback (before_migrate, @new_resource Before_migrate) callback (: before_symlink, @ new_resource.before_symlink) Simelink callback (: Before_restart, @ new_resource.before_restart) Restart callback (: after_restart, @ new_resource.after_rest art) Cleanup! Chef :: Log.info "# {@ new_resource} has been posted to # {@@ new_resource.deploy_to}" End
Comments
Post a Comment