module Capistrano::Magento2::Pending

Public Instance Methods

ensure_revision(inform_user = false) { || ... } click to toggle source
# File lib/capistrano/magento2/pending.rb, line 16
def ensure_revision inform_user = false
  if test "[ -f #{current_path}/REVISION ]"
    yield
  else
    warn "\e[0;31mSkipping pending changes check on #{host} (no REVISION file found)\e[0m" if inform_user
    return false
  end
  return true
end
from_rev() click to toggle source
# File lib/capistrano/magento2/pending.rb, line 26
def from_rev
  within current_path do
    current_revision = capture(:cat, "REVISION")

    run_locally do
      return capture(:git, "name-rev --always --name-only #{current_revision}") # find symbolic name for ref
    end
  end
end
to_rev() click to toggle source
# File lib/capistrano/magento2/pending.rb, line 36
def to_rev
  run_locally do
    to = fetch(:branch)

    # get target branch upstream if there is one
    if test(:git, "rev-parse --abbrev-ref --symbolic-full-name #{to}@{u}")
      to = capture(:git, "rev-parse --abbrev-ref --symbolic-full-name #{to}@{u}")
    end

    # find symbolic name for revision
    to = capture(:git, "name-rev --always --name-only #{to}")
  end
end