Merge pull request #20 from polleverywhere/override_time_format

Make the time format customizable
This commit is contained in:
Karl Matthias
2014-04-09 20:16:43 -07:00
2 changed files with 15 additions and 2 deletions
+10 -1
View File
@@ -72,7 +72,7 @@ Disabling Tagging for a Stage
-----------------------------
Sometimes you do not want to enable deployment tagging for a particular
stage. In that event, you can simply disable tagging by setting `no_deploytags`
lik so:
like so:
```ruby
set :no_deploytags, true
@@ -86,6 +86,15 @@ are hooked to the Capistrano Deploytags tasks will also still run, but they may
find their expectations are not met with regards to the cleanliness of the git
tree.
Customizing the Tag Format
--------------------------
You may override the time format in `config/deploy.rb`:
```ruby
set :deploytag_time_format, "%Y.%m.%d-%H%M%S-utc"
```
Viewing Deployment History
--------------------------
It's trivial to view the deployment history for a repo. From a checkout
+5 -1
View File
@@ -9,7 +9,11 @@ module Capistrano
end
def git_tag_for(stage)
"#{stage}-#{Time.new.utc.strftime('%Y.%m.%d-%H%M%S-utc')}"
"#{stage}-#{formatted_time}"
end
def formatted_time
Time.new.utc.strftime(fetch(:deploytag_time_format, "%Y.%m.%d-%H%M%S-utc"))
end
def safe_run(*args)