Deployment With Capistrano:
We can also deploy php app using ruby gem capistrano. For this we have to install it first on our system.
After that on any place we have to initialized it. For this use:
It will create following two files
config/deploy.rb
Capfile
Add in the Capfile
We can also use deply_via:remote_cache.
Now setup deploy and then execute it.
It will create three folders on root
We can also deploy php app using ruby gem capistrano. For this we have to install it first on our system.
gem install capistrano -v 2.15.5 gem install railsless-deploy
After that on any place we have to initialized it. For this use:
capify .
It will create following two files
config/deploy.rb
Capfile
Add in the Capfile
require 'railsless-deploy' load 'config/deploy'Now edit the deploy.rb
- set :application, "App name"
- set :repository, "https://username:password@yourrepository.org/project-repository.git"
- set :user, 'shh_username'
- set :scm, :git
- set :normalize_asset_timestamps, false
- set :deploy_to, "/full/path/to/your project"
- set :deploy_via, :copy
- set :use_sudo, false
- set :copy_exclude, [".git", ".DS_Store", ".gitignore", ".gitmodules", "Capfile", "config/deploy.rb"]
- server "server name", :app
- namespace :myapp do task :restart_webserver do #Show Start of Task print "Restarting webserver..." # Restart Web Server run "#{sudo} service apache2 restart" end end after "deploy","myapp:restart_webserver"
We can also use deply_via:remote_cache.
Now setup deploy and then execute it.
cap deploy:set
cap deploy
It will create three folders on root
project_root/releases
project_root/shared
project_root/current
No comments:
Post a Comment