

moving things in and out of load balancers). Migration itself needs to be run in careful lockstep with the rest of theĭeployment process (eg.
Web app chef code#
While staging the new code or configuration data can happen within a window, the Lock the table for updating for at least some period of time. First and foremost is that many table alterations Migrations can generally be applied idempotently but they have uniqueĬonstraints (pun definitely intended) that make them tricky in a Chef-like,Ĭonvergence-based system. With migrations on a production application, IĮncourage using Chef and the application cookbooks to handle deploying the codeĪnd writing configuration files, but use something more specific to run theĪll good choices for this orchestration tooling. Nature the application does not yet have users so some level of eventualĬonsistency is more acceptable.

Some initial operations like creating the database and/orĭatabase user are more reasonable as they tend to be done only once and by their For anything more complex I highly recommend not running database For "toy" applications where the app andĭatabase run together on a single machine, this is fine and is a nice time Several of the web application deployment plugins include optional support to Newer versions of the cookbooks they come from, though most have stayed similar Individual subresources may need to be tweaked to work with Subresources no longer use the complexĪctions-as-callbacks arrangement as existed before, instead following normalĬhef recipe flow. With the removal of the deploy resource, the callback properties and commandsĪre no longer used as well. Resource has few benefits in a config-managed world and introduced a lot ofĬomplexity and moving pieces that are no longer required. The pseudo-Capistrano layout used by the deploy

As a side effect of this, you'll likely want to point the upgradedĭeployment at a new folder or manually clean the current and shared foldersįrom the existing folder. The deploy resource is no longer used so these aren't The properties related to the deploy resource like strategy and symlinks Likely want to use the application_git cookbook, otherwise just use theīuilt-in git or svn resources as per normal. If you were deploying from a private git repository you will The SCM-related properties like repository and revision are now handled by The packages property has been removed as this is more easily handled via The name property no longerĮxists, with the name attribute being used as the path to the deployment. While the overall design of the revamped application resource is similar to theĤ.x version, some changes will need to be made. Some test recipes are available as examples for common application frameworks: Will be the default user and group for the resource.Īll other actions and properties are the same as the similar resource in core Chef. If an owner or group is declared for the application, those If the resource name is a relative path, it will be expanded relative to theĪpplication path. Resources extend the core Chef resources to take some application-levelĪpplication '/opt/myapp' do template 'nf' do source '' end directory 'logs' end The application_cookbook_file, application_directory, application_file, and application_template action_on_update_immediately – Run the action_on_update notification withĪpplication_cookbook_file, application_directory, application_file, application_template.action_on_update – Action to run on the application resource when any.owner – System user to deploy the application as.group – System group to deploy the application as.environment – Environment variables for all application deployment steps.path – Path to deploy the application to.:reload - Run :reload on all subresources that support it.:restart - Run :restart on all subresources that support it.:stop - Run :stop on all subresources that support it.:start - Run :start on all subresources that support it.

Application '/opt/test_sinatra' do git '' bundle_install do deployment true end unicorn do port 9000 end end Actions
