Merge pull request #33 from vitalied/master

Update for Cap 3.7
This commit is contained in:
Gavin Heavyside
2017-02-07 18:45:20 +00:00
committed by GitHub
3 changed files with 14 additions and 11 deletions
+6 -3
View File
@@ -8,10 +8,13 @@ but as Capistrano 3 is multistage by default (unlike Cap 2) :stage should
already be set, but you can override the variable if you want to change the
name of the tag.
### Requires Capistrano 3
### Requires Capistrano 3.7
As of version 1.0.0, this plugin requires Cap 3. If you need a Capistrano
2 compatible version, then use `gem 'capistrano-deploytags', '~> 0.9.2'`
As of version 1.0.7, this plugin requires Cap 3.7.
If you need a Capistrano < 3.7 compatible version, then use `gem 'capistrano-deploytags', '1.0.6'`
If you need a Capistrano 2 compatible version, then use `gem 'capistrano-deploytags', '~> 0.9.2'`
### What It Does
+3 -3
View File
@@ -1,8 +1,8 @@
Gem::Specification.new do |s|
s.name = 'capistrano-deploytags'
s.license = 'BSD-2-Clause'
s.version = '1.0.6'
s.date = '2017-01-06'
s.version = '1.0.7'
s.date = '2017-02-07'
s.summary = 'Add dated, environment-specific tags to your git repo at each deployment.'
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.
@@ -11,7 +11,7 @@ Gem::Specification.new do |s|
s.email = ['relistan@gmail.com', 'gavin.heavyside@mydrivesolutions.com']
s.files = `git ls-files lib`.split(/\n/) + %w{ README.md LICENSE }
s.homepage = 'http://github.com/mydrive/capistrano-deploytags'
s.add_dependency 'capistrano', '>= 3.2.0'
s.add_dependency 'capistrano', '>= 3.7.0'
# s.add_development_dependency 'capistrano-spec'
s.add_development_dependency 'rake'
s.add_development_dependency 'rspec', '~> 3.0.0'
+5 -5
View File
@@ -13,7 +13,7 @@ namespace :deploy do
raise 'define :branch and :stage'
end
strategy.git "fetch #{fetch(:git_remote, 'origin')}"
execute :git, "fetch #{fetch(:git_remote, 'origin')}"
diff_output = capture :git, "diff #{branch} --shortstat"
@@ -22,9 +22,9 @@ namespace :deploy do
raise 'Dirty git tree'
end
strategy.git "checkout #{branch}"
execute :git, "checkout #{branch}"
info "Pulling from #{branch}"
strategy.git "pull #{fetch(:git_remote, 'origin')} #{branch}"
execute :git, "pull #{fetch(:git_remote, 'origin')} #{branch}"
end
end
end
@@ -40,8 +40,8 @@ namespace :deploy do
commit_message = CapistranoDeploytags::Helper.commit_message(latest_revision, fetch(:stage))
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}"
execute :git, "tag -a #{tag_name} -m \"#{commit_message}\" #{latest_revision}"
execute :git, "push #{fetch(:git_remote, 'origin')} #{tag_name}"
end
info "[cap-deploy-tagger] Tagged #{latest_revision} with #{tag_name}"