Sha256: d8d4e4af64090fcb9de8c1ca4bccbf8937fb4d2cc3f025f69216a9615d7ccc79

Contents?: true

Size: 697 Bytes

Versions: 2

Compression:

Stored size: 697 Bytes

Contents

require "capistrano-rails-server/recipes/common"

configuration = Capistrano::Configuration.respond_to?(:instance) ?
  Capistrano::Configuration.instance(:must_exist) :
  Capistrano.configuration(:must_exist)

configuration.load do
  namespace :check do
    desc "Make sure local git is in sync with remote."
    task :revision, roles: :web do
      unless `git rev-parse HEAD` == `git rev-parse origin/#{branch}`
        puts "WARNING: HEAD is not the same as origin/#{branch}"
        puts "Run `git push` to sync changes."
        exit
      end
    end
    before "deploy", "check:revision"
    before "deploy:migrations", "check:revision"
    before "deploy:cold", "check:revision"
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
capistrano-rails-server-1.2.0 lib/capistrano-rails-server/recipes/check.rb
capistrano-rails-server-1.1 lib/capistrano-rails-server/recipes/check.rb