Created
March 10, 2011 22:50
-
-
Save danielpietzsch/865115 to your computer and use it in GitHub Desktop.
Deploy a specific or the current Git branch by default using Capistrano
This file contains hidden or 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 characters
# parses out the current branch you're on. See: http://www.harukizaemon.com/2008/05/deploying-branches-with-capistrano.html | |
current_branch = `git branch`.match(/\* (\S+)\s/m)[1] | |
# use the branch specified as a param, then use the current branch. If all fails use master branch | |
set :branch, ENV['branch'] || current_branch || "master" # you can use the 'branch' parameter on deployment to specify the branch you wish to deploy |
gtd
commented
Apr 21, 2018
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment