Comments (8)
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.
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.
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.
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.
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.
The README was updated in commit a24c306
from capistrano-deploytags.
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.
Great stuff, thanks!
from capistrano-deploytags.
Related Issues (18)
- latest tag isn't updated if version hasn't changed HOT 1
- Tags with initial branch setting instead of actual branch deployed HOT 2
- hardcoded assumption that 'origin' remote exists HOT 4
- Don't retag redeploys HOT 2
- Make timestamps UTC to better facilitate remote teams HOT 1
- Capistrano 3 Support HOT 4
- LoadError ... deploy_tags.rb.orig HOT 1
- Get rid of the -latest tag HOT 3
- Version 1 missing from RubyGems.org HOT 4
- Pushing deployment tag fails when other unrelated tags already exist on remote HOT 2
- Does not respect the -n (--dry-run) flag HOT 2
- Small inconsistency HOT 1
- Release version with fix for deploytag_commit_message variable HOT 1
- hello! i have a similar gem HOT 2
- Running cap production deploy:migrations does not tag HOT 3
- Can no longer deploy a specific revision HOT 9
- Tags aren't removed on deploy:rollback HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from capistrano-deploytags.