Capistrano .. return code for a PHP project

I'm looking for an easy way to revert to a previous release if something goes wrong with the latest version in Capistrano

Is there any command like cap goback to undo the last deployment ? (thus updating the current symbolic link to her old location )

Is it built-in or do I just need to complete the task myself?

Here is my recipe:

set :user, "root"
set :use_sudo, false

set :domain, "www.domain.info"
set :deploy_to, "/home/beta2"
set :current_dir, "public_html"

set :scm, "git"
set :repository,  "git@github.com:user/ac.git"
set :deploy_via, :remote_cache
set :scm_verbose, true
set :git_enable_submodules, 1

role :web, domain
role :app, domain


task :link_shared_directories do     
  run "ln -s #{shared_path}/photos #{release_path}/photos"
end    

after "deploy:update_code", :link_shared_directories
+3
source share
2 answers

If you are using the standard capistrano setting, look at these tasks:

:
cap deploy: rollback: code

, .

+3

- , , , , .

, GitHub, Railsless Deploy, , , .

, , , , .

0

Source: https://habr.com/ru/post/1713136/


All Articles