Posts

Showing posts with the label Deployment

Deploy Application via Chef

After creating the Ruby on Rails application mentioned in my blog , the next task was to deploy the application to a hosted web server. The traditional way would be to write rake tasks and trigger them manually or using a CI build/deploy. Well chef provides another easy solution to deploy an application. The recipe below performs all the tasks of deploying an application. The before_migrate script contains the tasks that need to be performed before the application kicks in. The migration_command is the final command that is run to mark deployment successful. deploy_revision is used to make sure that the recipe would only be executed once the git head changes in the repository from the last deployed version. symlink_before_migrate can be used to create symlinks to the yml files used in the configuring the application. The deploy cookbook for a basic app looks like below app_user="user" deploy_dir="/opt/application_deploy" user app_user directory "/home...