问题
How can I make a datetime global directory variable in Capistrano 3? Basically the scenario is: I want to create that variable before deploy start and make it available to other tasks. The value of the variable is date and time. So that will be used for backup tasks. How is it possible?
Thanks in advance.
回答1:
In your deploy.rb, you can set a variable (set :my_datetime, Time.now
) and then use it elsewhere (fetch :my_datetime
).
来源:https://stackoverflow.com/questions/34645995/date-time-directory-name-global-variable-in-capistrano