0

Is it possible to configure Capistrano so it will remember previous choices?

for example, when asking for a branch name:

ask :branch, 'master'

I would like it to remember the last branch name rather than using the default master.

If that is not possible, would it be possible to use an environment variable in place of master?

George
  • 2,860
  • 18
  • 31

1 Answers1

0

I couldn't find a way to remember answers, but setting from environment variables is pretty simple.

ask :branch, ENV.fetch('BRANCH', 'master')

That also allows you to specify the arguments on the command line eg:

cap prd deploy BRANCH=special

Thanks go to this answer to a slightly different question.

George
  • 2,860
  • 18
  • 31