Skip to content

Commit

Permalink
Replace outdated cap-deploy-tagger with native task
Browse files Browse the repository at this point in the history
  • Loading branch information
rubyconvict committed Jul 18, 2017
1 parent 805470b commit b6c0f1f
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 2 deletions.
20 changes: 20 additions & 0 deletions lib/capistrano/tasks/new_artrails_capistrano.rake
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,8 @@ namespace :load do
set :proxy_port, nil # e.g. '3128'

set :app_address, nil

set :skip_deploy_tagging, true
end
end

Expand Down Expand Up @@ -161,6 +163,23 @@ namespace :maintenance do
end

namespace :deploy do
desc "Tag deployed release"
task :tag do
run_locally do
if ENV['SKIP_DEPLOY_TAGGING'] || fetch(:skip_deploy_tagging, false)
info "Skipped deploy tagging"
else
tag_name = "#{fetch(:deploy_tag, "deployed")}_#{fetch(:stage)}"
latest_revision = fetch(:current_revision)
unless fetch(:sshkit_backend) == SSHKit::Backend::Printer # unless --dry-run flag present
execute :git, "tag -f #{tag_name} #{latest_revision}"
execute :git, "push -f --tags"
end
info "Tagged #{latest_revision} with #{tag_name}"
end
end
end

task :front do
on roles :app, exclude: :no_release do
puts '[FRONT] updating local cache'
Expand Down Expand Up @@ -814,3 +833,4 @@ after "deploy:symlink:release", "artrails:symlink:log"
after "maintenance:on", "deploy:isItWorking:deactivate"
after "maintenance:off", "deploy:isItWorking:activate"
after "maintenance:off", "artrails:check_is_it_working"
after "deploy:cleanup", "deploy:tag"
2 changes: 0 additions & 2 deletions new_artrails_capistrano.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,6 @@ Gem::Specification.new do |spec|
spec.add_dependency 'rack', '>= 1.6', '< 2'
spec.add_dependency 'turnout', '>= 2.2', '< 3'

spec.add_dependency 'cap-deploy-tagger', '>= 0.2', '< 1'

# http://yehudakatz.com/2010/12/16/clarifying-the-roles-of-the-gemspec-and-gemfile/
spec.add_development_dependency 'bundler', '~> 1.10'
spec.add_development_dependency 'rake', '~> 10.0'
Expand Down

0 comments on commit b6c0f1f

Please sign in to comment.