Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tags with initial branch setting instead of actual branch deployed #11

Closed
sci-phi opened this issue Aug 20, 2013 · 2 comments
Closed

Tags with initial branch setting instead of actual branch deployed #11

sci-phi opened this issue Aug 20, 2013 · 2 comments

Comments

@sci-phi
Copy link

sci-phi commented Aug 20, 2013

I added this gem and deployed, and it basically worked, but used the "master" prefix when instead of the appropriate branch name.

triggering after callbacks for `deploy'
* 2013-08-20 15:17:22 executing `git:tagdeploy'
** Tagging 2db8b31a9 for deployment
Counting objects: 1, done.
Writing objects: 100% (1/1), 184 bytes | 0 bytes/s, done.
Total 1 (delta 0), reused 0 (delta 0)
To git@github.com:ORG/PROJECT.git
* [new tag]         master-2013.08.20-151722 -> master-2013.08.20-151722

I was deploying to my dev environment, from a differently-named feature branch, yet 'master' was used as the tag name. I think it should be possible to make it 'deploy' or have it use the actual branch name (or only run the tagdeploy task on production deploys...)

Some background : In -dev, I dynamically set the branch Capistrano deploys based on my current working branch, with a default of master.

What I guess is happening is your gem needs the branch set at load rather than execution (which seems to explain why the require errors if at top of the file with the branch setting a few lines afterwards)

Following is the code I use in my -dev deploys...

def get_current_git_branch_name
    `git status -s -b`.split("\n").first.match(/##\W(.+)/)[1]
end

task :deploy_working_branch do
    set :branch, get_current_git_branch_name
end
after :dev, :deploy_working_branch
@sci-phi
Copy link
Author

sci-phi commented Aug 20, 2013

Oh, I see now that's what the 'stage' setting is for... you can close in favor of my earlier issue re: documenting those #10

Thanks!

@bazbremner
Copy link
Contributor

@sci-phi Thanks for the update and the other issue. Closing in favour of #10

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants