16 Commits
1.0.0 ... 1.0.4

Author SHA1 Message Date
Karl Matthias
561331b263 Merge pull request #30 from subodhkhanduri1/master
Bump patch version and date
2015-10-18 09:14:45 -07:00
Subodh Khanduri
57efd74341 Bump version and date 2015-10-18 20:48:37 +05:30
Gavin Heavyside
5d31bd7df6 Merge pull request #29 from subodhkhanduri1/master
Add support for custom tag name
2015-10-16 14:18:05 +01:00
Subodh Khanduri
1a8635a98b Add support for custom tag name 2015-10-16 17:58:29 +05:30
Gavin Heavyside
1cff76230d Merge pull request #28 from lacco/master
Update README
2015-08-04 10:24:28 +01:00
Kai Schlichting
eeb75048ba Use correct Gemfile group in README 2015-08-04 11:23:17 +02:00
Kai Schlichting
1ac8d2f9c4 Documentation for deploytag_utc 2015-08-04 11:23:17 +02:00
Gavin Heavyside
36f2405a31 Bump date 2015-05-11 14:45:22 +01:00
Gavin Heavyside
e9ba5e715c Bump version 2015-05-11 14:45:00 +01:00
Gavin Heavyside
11eabe5b7c Merge pull request #27 from dicksonlabs/respect_dry_run
don't create and push the tag when sshkit backend is SSHKit::Backend:::Printer
2015-05-11 14:44:03 +01:00
Ed Slocomb
7eaf0a83f8 don't create and push the tag when sshkit backend is SSHKit::Backend::Printer 2015-05-08 13:25:14 -07:00
Gavin Heavyside
95b1cc15b9 Update date of latest version... 2015-01-22 15:11:40 +00:00
Gavin Heavyside
9f9a0c3d6a Add license to gemspec 2015-01-22 15:09:00 +00:00
Gavin Heavyside
536214fd03 Bump patch version 2015-01-22 15:05:44 +00:00
Gavin Heavyside
964c57d21f Merge pull request #25 from matiaskorhonen/localtime
Make UTC optional
2014-10-23 12:34:04 +01:00
Matias Korhonen
675361e5d9 Makes UTC optional 2014-10-23 13:19:17 +03:00
4 changed files with 23 additions and 8 deletions

View File

@@ -39,7 +39,7 @@ to the `development` group of your Gemfile with `require: false`:
```ruby
# Gemfile
group :deployment do
group :development do
gem 'capistrano-deploytags', '~> 1.0.0', require: false
end
```
@@ -109,6 +109,12 @@ You may override the time format in `deploy.rb` or your stage:
set :deploytag_time_format, "%Y.%m.%d-%H%M%S-utc"
```
To use your local time and not UTC (so that ```Time.now``` and not ```Time.now.utc``` is used internally):
```ruby
set :deploytag_utc, false
```
### Customizing the Tag Commit Message
By default, Capistrano Deploytags will create a tag with a message that indicates

View File

@@ -1,9 +1,10 @@
Gem::Specification.new do |s|
s.name = 'capistrano-deploytags'
s.version = '1.0.0'
s.date = '2014-06-14'
s.license = 'BSD-2-Clause'
s.version = '1.0.4'
s.date = '2015-10-18'
s.summary = 'Add dated, environment-specific tags to your git repo at each deployment.'
s.description = <<-EOS
s.description = <<-EOS
Capistrano Deploytags is a simple plugin to Capistrano 3 that works with your deployment framework to track your code releases. All you have to do is require capistrano-deploytags/capistrano and each deployment will add a new tag for that deployment, pointing to the latest commit. This lets you easily see which code is deployed on each environment, and allows you to figure out which code was running in an environment at any time in the past.
EOS
s.authors = ['Karl Matthias', 'Gavin Heavyside']

View File

@@ -11,7 +11,13 @@ module CapistranoDeploytags
end
def self.formatted_time
Time.new.utc.strftime(fetch(:deploytag_time_format, "%Y.%m.%d-%H%M%S-utc"))
now = if fetch(:deploytag_utc, true)
Time.now.utc
else
Time.now
end
now.strftime(fetch(:deploytag_time_format, "%Y.%m.%d-%H%M%S-#{now.zone.downcase}"))
end
def self.commit_message(current_sha, stage)

View File

@@ -35,12 +35,14 @@ namespace :deploy do
if ENV['NO_DEPLOYTAGS'] || fetch(:no_deploytags, false)
info "[deploytags] Skipping deploytags"
else
tag_name = CapistranoDeploytags::Helper.git_tag_for(fetch(:stage))
tag_name = ENV['CUSTOM_DEPLOYTAG'] || fetch(:custom_deploytag) || CapistranoDeploytags::Helper.git_tag_for(fetch(:stage))
latest_revision = fetch(:current_revision)
commit_message = CapistranoDeploytags::Helper.commit_message(latest_revision, fetch(:stage))
strategy.git "tag -a #{tag_name} -m \"#{commit_message}\" #{latest_revision}"
strategy.git "push #{fetch(:git_remote, 'origin')} #{tag_name}"
unless fetch(:sshkit_backend) == SSHKit::Backend::Printer # unless --dry-run flag present
strategy.git "tag -a #{tag_name} -m \"#{commit_message}\" #{latest_revision}"
strategy.git "push #{fetch(:git_remote, 'origin')} #{tag_name}"
end
info "[cap-deploy-tagger] Tagged #{latest_revision} with #{tag_name}"
end