Deploy a separate git branch via capistrano on the staging server

I have a branch masterthat is used for deployment on an intermediate server. And I have a branch stablethat is used for deployment on a production server. Capistrano script I use customization this way.

Current workflow: Whenever a production problem arises, I go out of the branch stable, fix things, fix them, merge with stable, and then deploy to production.

This does not give me the opportunity to check this error correction (happened in this hot fix branch) on my intermediate server. Ideally, I would like to:

Required Workflow: Whenever there is a problem with the product, I disconnect from the branch stable, fix things, fix them, combine with master, deploy and test this fix on the intermediate server, check if it works, then merge this hot fix go to stableand expand it.

How do I do this with Capistrano? Please, help.

+5
source share
2 answers

Disclaimer: Forgive me if I misunderstood your question, but I think you have already answered your question.

Git - git. . Capistrano , , , , .

, , , , , , . .

deploy.rb

  set :stages, %w(staging production)
  set :default_stage, "staging"

deploy/staging.rb #cap deploy

  set :branch, 'master'

deploy/production.rb #cap production deploy

  set :branch, 'stable'
+7

, - capistrano. , Capistrano .

  • hot fix, hot fix, hotfix-20121203

    git checkout -b hotfix-20121203 
    
  • hot fix , .

    git checkout staging
    git merge hotfix-20121203
    cap staging deploy
    
  • ,

    git checkout master
    git merge hotfix-20121203
    cap production deploy
    
+3

All Articles