Sha256: 846297729c6f3342cb8c59d943b472bf57a96a13823230cffde70a647bd95286

Contents?: true

Size: 711 Bytes

Versions: 77

Compression:

Stored size: 711 Bytes

Contents

module Kontena
  module Callbacks
    class SetServerProviderAfterDeploy < Kontena::Callback

      matches_commands 'master create'

      def after
        extend Kontena::Cli::Common
        return unless command.exit_code == 0
        return unless config.current_master
        return unless config.current_master.name == command.result[:name]
        return unless command.result[:provider]

        require 'shellwords'

        cmd = ['master', 'config', 'set', "server.provider=#{command.result[:provider]}"]
        spinner "Setting Master configuration server.provider to '#{command.result[:provider]}'" do |spin|
          spin.fail! unless Kontena.run(cmd)
        end
      end
    end
  end
end

Version data entries

77 entries across 77 versions & 2 rubygems

Version Path
krates-1.7.11 lib/kontena/callbacks/master/deploy/56_set_server_provider_after_deploy.rb
krates-1.7.10 lib/kontena/callbacks/master/deploy/56_set_server_provider_after_deploy.rb
krates-1.7.9 lib/kontena/callbacks/master/deploy/56_set_server_provider_after_deploy.rb
krates-1.7.8 lib/kontena/callbacks/master/deploy/56_set_server_provider_after_deploy.rb
krates-1.7.7 lib/kontena/callbacks/master/deploy/56_set_server_provider_after_deploy.rb
krates-1.7.6 lib/kontena/callbacks/master/deploy/56_set_server_provider_after_deploy.rb
krates-1.7.5 lib/kontena/callbacks/master/deploy/56_set_server_provider_after_deploy.rb
krates-1.7.4 lib/kontena/callbacks/master/deploy/56_set_server_provider_after_deploy.rb
krates-1.7.3 lib/kontena/callbacks/master/deploy/56_set_server_provider_after_deploy.rb
krates-1.7.2 lib/kontena/callbacks/master/deploy/56_set_server_provider_after_deploy.rb
krates-1.7.1 lib/kontena/callbacks/master/deploy/56_set_server_provider_after_deploy.rb
krates-1.7.0 lib/kontena/callbacks/master/deploy/56_set_server_provider_after_deploy.rb
krates-1.6.9 lib/kontena/callbacks/master/deploy/56_set_server_provider_after_deploy.rb
krates-1.6.8 lib/kontena/callbacks/master/deploy/56_set_server_provider_after_deploy.rb
krates-1.6.7 lib/kontena/callbacks/master/deploy/56_set_server_provider_after_deploy.rb
krates-1.6.6 lib/kontena/callbacks/master/deploy/56_set_server_provider_after_deploy.rb
krates-1.6.5 lib/kontena/callbacks/master/deploy/56_set_server_provider_after_deploy.rb
krates-1.6.4 lib/kontena/callbacks/master/deploy/56_set_server_provider_after_deploy.rb
krates-1.6.3 lib/kontena/callbacks/master/deploy/56_set_server_provider_after_deploy.rb
krates-1.6.2 lib/kontena/callbacks/master/deploy/56_set_server_provider_after_deploy.rb