Forked from ThePixelDeveloper/PHP Capistrano Recipe.rb
Created
December 4, 2009 11:50
Revisions
-
ThePixelDeveloper revised this gist
Oct 29, 2009 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,7 +1,7 @@ # -------------------------------------------- # General # -------------------------------------------- set :shared_children, %w(cache logs) # Shared directories, these directories contain generated content which should not be wiped out during deployments. set :application, "domain.com" # Application name set :deploy_to, "/var/www/#{application}/#{stage}" # Path where files are deployed to ... -
ThePixelDeveloper revised this gist
Oct 28, 2009 . 1 changed file with 3 additions and 3 deletions.There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -36,11 +36,11 @@ task :finalize_update, :except => { :no_release => true } do # Make sure the log and upload directories do not exist. run "rmdir #{latest_release}/application/logs" run "rmdir #{latest_release}/application/cache" # Symlink the shared directories to the directories in your application. run "ln -s #{shared_path}/logs #{latest_release}/application/logs" run "ln -s #{shared_path}/cache #{latest_release}/application/cache" # chmod the files and directories. run "find #{shared_path} -type d -exec chmod 0755 {} \\;" -
ThePixelDeveloper revised this gist
Oct 28, 2009 . 1 changed file with 2 additions and 2 deletions.There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -51,8 +51,8 @@ namespace :web do task :disable do # When cap deploy:web:disable is run, copy a maintenance.html page from the shared directory # to the webroot. You will typically have Apache check for this file and disable access to the # site if it exists. run "cp #{shared_path}/maintenance.html #{latest_release}" run "echo #{stage}" end -
ThePixelDeveloper revised this gist
Oct 28, 2009 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -50,7 +50,7 @@ namespace :web do task :disable do # When cap deploy:web:disable is run, copy a maintenance.html page from the shared directory # to the webroot. You will typically have Apache check for this file and disable access to the # site if it exists. run "cp #{shared_path}/maintenance.html #{latest_release}" -
ThePixelDeveloper revised this gist
Oct 28, 2009 . 1 changed file with 25 additions and 16 deletions.There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,50 +1,58 @@ # -------------------------------------------- # General # -------------------------------------------- set :shared_children, %w(config logs) # Shared directories, these directories contain generated content which should not be wiped out during deployments. set :application, "domain.com" # Application name set :deploy_to, "/var/www/#{application}/#{stage}" # Path where files are deployed to ... # -------------------------------------------- # Server # -------------------------------------------- # Commands on the server are run as the following user : set :runner, "website" set :user, "website" set :use_sudo, false # sudo isn't required for my deployment. # -------------------------------------------- # Repository # -------------------------------------------- set :scm, :bzr # I am using bazaar, so I specify it here set :deploy_via, :export # This will use bzr export as the method of obtaining the code from the repository. set :repository, "/home/user/repositories/domain.com" # This is the path to the repository on the server, we pushed the code here earlier. role :web, "#{application}" # -------------------------------------------- # SSH # -------------------------------------------- ssh_options[:keys] = %w(/home/user/.ssh/private_key) # SSH key ssh_options[:port] = 22 # -------------------------------------------- # Overloaded Methods. # -------------------------------------------- namespace :deploy do task :finalize_update, :except => { :no_release => true } do # Make sure the log and upload directories do not exist. run "rmdir #{latest_release}/application/logs" run "rmdir #{latest_release}/upload" # Symlink the shared directories to the directories in your application. run "ln -s #{shared_path}/logs #{latest_release}/application/logs" run "ln -s #{shared_path}/upload #{latest_release}/upload" # chmod the files and directories. run "find #{shared_path} -type d -exec chmod 0755 {} \\;" run "find #{latest_release} -type d -exec chmod 0755 {} \\;" run "find #{latest_release} -type f -exec chmod 644 {} \\;" end namespace :web do task :disable do # When cap deploy:web:disable is run, copy a maintenance.html page from the shared directory # to the webroot. You will typically have Apache check for this file and disable access to the # site if it exists. run "cp #{shared_path}/maintenance.html #{latest_release}" run "echo #{stage}" end @@ -54,5 +62,6 @@ end end # Hook the web disable and disable events into the deployment. after "deploy:update_code", "deploy:web:disable" after "deploy:symlink", "deploy:web:enable" -
ThePixelDeveloper revised this gist
Oct 28, 2009 . 1 changed file with 35 additions and 35 deletions.There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -2,7 +2,7 @@ set :application, "domain.com" # Application name set :deploy_to, "/var/www/#{application}/#{stage}" # Path where files are deployed to ... # Commands on the server are run as the following user : set :runner, "website" set :user, "website" set :use_sudo, false # sudo isn't required for my deployment. @@ -18,40 +18,40 @@ namespace :deploy do desc <<-DESC [internal] Touches up the released code. This is called by update_code after the basic deploy finishes. It assumes a Rails project was deployed, so if you are deploying something else, you may want to override this task with your own environment's requirements DESC task :finalize_update, :except => { :no_release => true } do # link log and upload directories run "rmdir #{latest_release}/application/logs" run "rmdir #{latest_release}/upload" run "ln -s #{shared_path}/logs #{latest_release}/application/logs" run "ln -s #{shared_path}/upload #{latest_release}/upload" # copy configuration files run "cp -rf #{shared_path}/config/ #{latest_release}/application/" # copy index.php run "cp -f #{shared_path}/index.php #{latest_release}/index.php" # chmod directories and files run "find #{shared_path} -type d -exec chmod 0755 {} \\;" run "find #{latest_release} -type d -exec chmod 0755 {} \\;" run "find #{latest_release} -type f -exec chmod 644 {} \\;" end namespace :web do task :disable do run "cp #{shared_path}/maintenance.html #{latest_release}" run "echo #{stage}" end task :enable do run "rm -f #{latest_release}/maintenance.html" end end end after "deploy:update_code", "deploy:web:disable" -
ThePixelDeveloper revised this gist
Oct 28, 2009 . 1 changed file with 6 additions and 6 deletions.There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -3,13 +3,13 @@ set :deploy_to, "/var/www/#{application}/#{stage}" # Path where files are deployed to ... # Commands on the server are run as the following user : set :runner, "website" set :user, "website" set :use_sudo, false # sudo isn't required for my deployment. set :scm, :bzr # I am using bazaar, so I specify it here set :deploy_via, :export # This will use bzr export as the method of obtaining the code from the repository. set :repository, "/home/user/repositories/domain.com" # This is the path to the code repository on the server, remember when you pushed the code up to the server? role :web, "#{application}" -
ThePixelDeveloper revised this gist
Oct 28, 2009 . 1 changed file with 5 additions and 13 deletions.There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,27 +1,19 @@ set :shared_children, %w(config logs) # Shared directories, these directories contain generated content which should not be wiped out during deployments. set :application, "domain.com" # Application name set :deploy_to, "/var/www/#{application}/#{stage}" # Path where files are deployed to ... # Commands on the server are run as the following user : set :runner, "website" set :user, "website" set :use_sudo, false # sudo isn't required for my deployment. set :scm, :bzr # I am using bazaar, so I specify it here set :deploy_via, :export # This will use bzr export as the method of obtaining the code from the repository. set :repository, "/home/user/repositories/domain.com" # This is the path to the code repository on the server, remember when you pushed the code up to the server? role :web, "#{application}" ssh_options[:keys] = %w(/home/user/.ssh/private_key) # SSH key ssh_options[:port] = 22 namespace :deploy do -
ThePixelDeveloper revised this gist
Oct 28, 2009 . 1 changed file with 6 additions and 12 deletions.There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,4 +1,4 @@ # Shared directories, these directories contain generated content which should not be wiped out during deployments. set :shared_children, %w(config logs) # Application name @@ -14,19 +14,13 @@ # Sudo isn set :use_sudo, false set :scm, :bzr # I am using bazaar, so I specify it here set :deploy_via, :export # This will use bzr export as the method of obtaining the code from the repository. set :repository, "/home/user/repositories/domain.com" # This is the path to the code repository on the server, remember when you pushed the code up to the server? role :web, "#{application}" ssh_options[:keys] = %w(/home/mathew/.ssh/private_key) ssh_options[:port] = 22 -
ThePixelDeveloper revised this gist
Oct 28, 2009 . 1 changed file with 16 additions and 21 deletions.There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,30 +1,25 @@ # Shared directories, these are directories containing generated content which should not be wiped out during deployments. set :shared_children, %w(config logs) # Application name set :application, "domain.com" # Path where files are deployed to ... set :deploy_to, "/var/www/#{application}/#{stage}" # Commands on the server are run as the following user : set :runner, "website" set :user, "website" # Sudo isn set :use_sudo, false # I am using bazaar, so I specify it here set :scm, :bzr set :deploy_via, :export # This is the path to the code repository on the server, remember when you pushed the code up to the server? set :repository, "/var/www/repositories/website.com/" # ---------------------------------------------------------------------------- # Role settings # ---------------------------------------------------------------------------- -
ThePixelDeveloper revised this gist
Oct 15, 2009 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -4,7 +4,7 @@ # http://github.com/leehambley/railsless-deploy for any updates concerning this. # # gem sources -a http://gems.github.com/ # gem install capistrano-ext # gem install leehambley-railsless-deploy # ---------------------------------------------------------------------------- -
ThePixelDeveloper revised this gist
Oct 15, 2009 . 1 changed file with 9 additions and 0 deletions.There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,3 +1,12 @@ # This requires the capistrano-ext and railsless-deploy gems # # Github are disabling their gems service after 1 year starting from 2009, refer to # http://github.com/leehambley/railsless-deploy for any updates concerning this. # # gem sources -a http://gems.github.com/ # sudo gem install capistrano-ext # gem install leehambley-railsless-deploy # ---------------------------------------------------------------------------- # Capistrano settings # ---------------------------------------------------------------------------- -
ThePixelDeveloper created this gist
Oct 15, 2009 .There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,68 @@ # ---------------------------------------------------------------------------- # Capistrano settings # ---------------------------------------------------------------------------- set :shared_children, %w(config upload logs) # ---------------------------------------------------------------------------- # Application settings # ---------------------------------------------------------------------------- set :application, "website.com" set :deploy_to, "/var/www/website.com/#{stage}" set :runner, "website" set :user, "website" set :use_sudo, false # ---------------------------------------------------------------------------- # Repository settings # ---------------------------------------------------------------------------- set :scm, :bzr set :deploy_via, :export set :repository, "/var/www/repositories/website.com/" # This can be a github repository, etc ... mine is local. # ---------------------------------------------------------------------------- # Role settings # ---------------------------------------------------------------------------- role :web, "#{application}" # ---------------------------------------------------------------------------- # SSH settings # ---------------------------------------------------------------------------- ssh_options[:keys] = %w(/home/mathew/.ssh/private_key) ssh_options[:port] = 22 namespace :deploy do desc <<-DESC [internal] Touches up the released code. This is called by update_code after the basic deploy finishes. It assumes a Rails project was deployed, so if you are deploying something else, you may want to override this task with your own environment's requirements DESC task :finalize_update, :except => { :no_release => true } do # link log and upload directories run "rmdir #{latest_release}/application/logs" run "rmdir #{latest_release}/upload" run "ln -s #{shared_path}/logs #{latest_release}/application/logs" run "ln -s #{shared_path}/upload #{latest_release}/upload" # copy configuration files run "cp -rf #{shared_path}/config/ #{latest_release}/application/" # copy index.php run "cp -f #{shared_path}/index.php #{latest_release}/index.php" # chmod directories and files run "find #{shared_path} -type d -exec chmod 0755 {} \\;" run "find #{latest_release} -type d -exec chmod 0755 {} \\;" run "find #{latest_release} -type f -exec chmod 644 {} \\;" end namespace :web do task :disable do run "cp #{shared_path}/maintenance.html #{latest_release}" run "echo #{stage}" end task :enable do run "rm -f #{latest_release}/maintenance.html" end end end after "deploy:update_code", "deploy:web:disable" after "deploy:symlink", "deploy:web:enable"