Skip to content

Instantly share code, notes, and snippets.

@noginn
Created September 24, 2009 21:09
Show Gist options
  • Star 4 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save noginn/193055 to your computer and use it in GitHub Desktop.
Save noginn/193055 to your computer and use it in GitHub Desktop.
A Capistrano deployment recipe for Zend Framework applications
load 'deploy' if respond_to?(:namespace) # cap2 differentiator
load 'application/configs/deploy'
set :application, "application-name"
set :repository, "/path/to/repository"
set :deploy_to, "/path/to/application"
set :deploy_via, "copy"
set :scm, :git
set :scm_checkout, "export"
role :web, "domain"
role :app, "domain"
role :db, "domain", :primary => true
set :user, "user"
set :use_sudo, false
set :ssh_options, {:forward_agent => true}
namespace :deploy do
task :update do
transaction do
update_code
symlink
end
end
task :finalize_update do
transaction do
run "chmod -R g+w #{releases_path}/#{release_name}"
# Create symbolic links to shared resources
run "ln -nfs #{shared_path}/bootstrap.php #{releases_path}/#{release_name}/application/configs/bootstrap.php"
end
end
task :migrate do
# Override, we have no migrations
end
task :start, :roles => :app do
# Override but do nothing
end
task :stop, :roles => :app do
# Override but do nothing
end
task :restart do
# Override, no need to restart Apache
end
end
In your shell, run the following command:
cap deploy
This will now deploy your Zend Framework application to the remote server.
For more information and Capistrano installation instructions see the documentation, http://www.capify.org/index.php/Capistrano
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment