Support for specifying local/remote branch names #1

Closed
wants to merge 1 commit into
from

Conversation

Projects
None yet
2 participants
@rspeicher
Contributor

rspeicher commented Sep 21, 2010

I wanted to play with gitploy, messing around with deploying to a staging server and I wasn't using my master branch, but I noticed gitploy didn't have support for non-master branches so I added basic support for them.

Example deploy configuration to take advantage:

require 'gitploy/script'

configure do |c|
  c.repo = 'git@github.com:myuser/fooapp.git'
  c.path = '/var/www/fooapp'

  stage :staging do
    c.host = 'staging.fooapp.com'
    c.user = 'ninja'
    c.local_branch  = 'rails3'
    c.remote_branch = 'staging'
  end
end

setup do
  remote do
    run "mkdir -p #{config.path}"
    run "cd #{config.path} && git init"
    run "git checkout #{config.remote_branch}"
    run "git config --bool receive.denyNonFastForwards false"
    run "git config receive.denyCurrentBranch ignore"
  end
end

deploy do
  push!
  remote do
    run "cd #{config.path}"
    run "git checkout #{config.remote_branch}"
    run "git reset --hard"
    run "bundle install --without development --deployment"
    run "touch tmp/restart.txt"
  end
end
Add basic support for specifying local/remote branches
When not specified, local defaults to the current branch and remote to "master"
@brentd

This comment has been minimized.

Show comment
Hide comment
@brentd

brentd Sep 21, 2010

Owner

Nice! This was needed; you've spared me the work, sir. Thanks!

Owner

brentd commented Sep 21, 2010

Nice! This was needed; you've spared me the work, sir. Thanks!

This issue was closed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment