Class: ObsDeploy::CLI::Commands::GetPendingMigration

Inherits:
Dry::CLI::Command
  • Object
show all
Defined in:
lib/obs_deploy/cli/commands/get_pending_migration.rb

Instance Method Summary collapse

Instance Method Details

#call(url:, ignore_certificate:) ⇒ Object



10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
# File 'lib/obs_deploy/cli/commands/get_pending_migration.rb', line 10

def call(url:, ignore_certificate:, **)
  if ignore_certificate
    OpenSSL::SSL.send(:remove_const, :VERIFY_PEER)
    OpenSSL::SSL.const_set(:VERIFY_PEER, OpenSSL::SSL::VERIFY_NONE)
  end

  migrations = ObsDeploy::CheckDiff.new(server: url).migrations
  if migrations.empty?
    puts 'No pending migrations'
    exit(0)
  else
    puts migrations
    exit(1)
  end
end