mydrive / capistrano-deploytags

Add timestamped Git tags for each environment on deployment

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Can no longer deploy a specific revision

schnittchen opened this issue · comments

...because capistrano-deploytags considers it a dirty tree:

*** Preparing to deploy HEAD from branch 'master' to 'production'
*** Whoa there, partner. Dirty trees can't deploy. Git yerself clean first.

A workaround is to create a branch and use -s <branchname>

Sorry for not having put this into the readme. This workaround is exactly what we do. I think there is some consideration needed around how to do this better in the plugin. But there are constraints that make it hard to do differently than it is now.

What would happen if the check was bypassed?

One of the problems with that is that if you weren't actually up to date with what is in the repo (assuming you deploy directly from git like most people), you would tag the wrong commit with the deployment tag. You could also be deploying code you don't know changed. Lastly, other plugins like capistrano-detect-migrations rely on the tree being correct.

If that's the only issue, one could skip deploy tagging as well. Probably one would only want that on some kind of staging setup...

So, since the plugin is all about deploy tagging, I'm wondering how you're using it if not for deployment tags? We don't use it for staging, we use it for tracking which code has been deployed to which production server environment, and the capistrano-detect-migrations plugin uses the tags to idenify new Rails migrations.

I have a staging server environment which mirrors production closely (and at times not so closely). capistrano-deploytags tags deploys to that as well, since it's just a multistage environment. Is there a way to configure cap-deploytags to only tag deploys for a subset of multistage envs?

That would be a good feature, but no, not implemented. Pull requests welcome. :)

Closing as there is a known workaround and currently no obvious solution.