Giter Club home page Giter Club logo

Comments (8)

relistan avatar relistan commented on August 22, 2024

Thanks for contributing! Actually the very first paragraph of the README does say this, but maybe there is something more you think we should add? Normally if you use this with the capistrano multistage setup it just works. If you don't, then you need to define branch and stage as it says. Happy to take a contribution of a better explanation if you wouldn't mind giving me your thoughts on what you think it should say.

from capistrano-deploytags.

sci-phi avatar sci-phi commented on August 22, 2024

It does, and I missed that in my haste. I expected it to work with a vanilla capistrano deploy, not just in multistage scenarios. I did get it working, but had to insert a delayed step, like so -

task :update_stage do
  set :stage, "foo"
end
before "git:prepare_tree", "update_stage"

Also, it was very frustrating trying to test a deploy script when you kept harping on my tree being dirty... so I hacked it, like so -

def pending?
  # Do we have any changes vs HEAD on deployment branch?
  !(`git fetch && git diff #{branch} --shortstat`.strip.empty?)
end
def deploy_rb?
  !!(`git status -s`.strip =~ /config\/deploy\.rb/)
end
def solo?
  !!(`git fetch && git diff #{branch} --shortstat`.strip =~ /1 file changed/)
end
def deployable?
  if pending? then
    return false if (solo? && deploy_rb?)
    return true
  end
end

I'm rethinking tagging every single deploy however, as I was deploying at lot for testing and it just looked noisy. Would like some way to only tag staging/production deploys.

FYI : the main reason I tried this was for the related migration detection plugin.

from capistrano-deploytags.

sci-phi avatar sci-phi commented on August 22, 2024

Ooops, that was pasted from a spike file (I've tossed my actual hack now) and it looks like I reversed the booleans initially

from capistrano-deploytags.

relistan avatar relistan commented on August 22, 2024

You don't have to run a task to update the stage. You can just put set :stage, 'foo' right up at the top of your deploy.rb. Or am I missing something about why you coudn't do that?

It sounds like your use case is pretty much how a lot of us use multi stage (despite the name). If you have different environments to deploy to, just make each one a stage and it will work out of the box. This opens a whole nice set of possibilities for defining different settings per stage in a clean way as well. Of course you know your environment best, but I think you might be fighting the framework a bit here given what little I understand about how you are using it. I recommend having a read of this explanation.

Design goals of capistrano-deploytags were to make it work right out of the box without configuration, and to tag every deployment. It would be pretty trivial to add the ability not to tag a particular stage, though. I would guess that's the easiest way to do it. The stage could define :no_tagging or similar, and that would then not git tag for test or whatever other environment you don't want to tag. I'll have a look at that.

from capistrano-deploytags.

relistan avatar relistan commented on August 22, 2024

Oops, forgot to respond to the second part of that. If you just commit the code (doesn't have to be pushed) you will find that it works fine for modifying your deploy scripts. I'll add that to the README since it should be obvious to anyone who wants to use it. Thanks for pointing out the shortcoming.

from capistrano-deploytags.

relistan avatar relistan commented on August 22, 2024

The README was updated in commit a24c306

from capistrano-deploytags.

relistan avatar relistan commented on August 22, 2024

Simple addition to prevent tagging when desited, added here: bb520be . The readme is updated here: 3c6fc42 . I'll do a new release this afternoon.

from capistrano-deploytags.

sci-phi avatar sci-phi commented on August 22, 2024

Great stuff, thanks!

from capistrano-deploytags.

Related Issues (18)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.