Is there any way I can streamline my deployment process? I currently use these git and Capistrano commands:
git add .
git commit -am 'Comment...'
git push [name]
cap deploy:setup
cap deploy
cap deploy:cleanup
So if I want to make minor changes, I have to enter my password four times (once for push, once for setup, and twice for deploy). Is there any way I can reduce the amount of commands?
Your git workflow is pretty standard, and you’re not going to streamline it much. You don’t need to push every commit, I suppose, and there’s nothing wrong with a lot of small, atomic commits.
As far as
cap deploygoes, though, why are you running the setup and cleanup every time? Can’t you just runcap deploy? If you need to runcleanupevery time, try redefiningdeploy‘s default to include it. In yourdeploy.rb:namespace :deploy do desc <<-DESC Deploys your project. This calls both `update' and `restart'. Note that \ this will generally only work for applications that have already been deployed \ once. For a "cold" deploy, you'll want to take a look at the `deploy:cold' \ task, which handles the cold start specifically. DESC task :default do update restart cleanup # <-- this is added end endIf you have a good reason to run
setupevery time, you can add that to the redefined default task as well.