Commit db02c9b8271afd628b42141594cddd96d433bcc4

Authored by Daniel Beardsley
1 parent 98963feb
Exists in master and in 1 other branch production

Capistrano: deploy from fixed branch

Not the 'current' branch in the local clone fo the repo.

I feel like deploying from the current branch in the local clone is a
bit presumptous. I expect most people want to deploy from one branch
while allowing for development of several feature branches.

Right now you always have to remember to check out master before
deploying or you may deploy your feature branch (which may not even be
pushed).
config/config.example.yml
... ... @@ -57,6 +57,7 @@ deployment:
57 57 app: errbit.example.com
58 58 db: errbit.example.com
59 59 repository: http://github.com/errbit/errbit.git
  60 + branch: master
60 61 user: deploy
61 62 deploy_to: /var/www/apps/errbit
62 63 # setup path to unicorn pids folder (or deploy_to/shared/pids will be used)
... ...
config/deploy.example.rb
... ... @@ -35,8 +35,7 @@ set :copy_compression, :bz2
35 35  
36 36 set :scm, :git
37 37 set :scm_verbose, true
38   -set(:current_branch) { `git branch`.match(/\* (\S+)\s/m)[1] || raise("Couldn't determine current branch") }
39   -set :branch, defer { current_branch }
  38 +set :branch, config['branch'] || 'master'
40 39  
41 40 before 'deploy:assets:symlink', 'errbit:symlink_configs'
42 41 # if unicorn is started through something like runit (the tool which restarts the process when it's stopped)
... ...