Sha256: 2239277a77ce14bd463528977393715ef44dff7ef93314c0506d207f804e3ffc

Contents?: true

Size: 696 Bytes

Versions: 29

Compression:

Stored size: 696 Bytes

Contents

module Kontena
  module Callbacks
    class SetServerProviderAfterDeploy < Kontena::Callback

      include Kontena::Cli::Common

      matches_commands 'master create'

      def after
        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
          Kontena.run(cmd.shelljoin)
        end
      end
    end
  end
end

Version data entries

29 entries across 29 versions & 1 rubygems

Version Path
kontena-cli-1.1.2 lib/kontena/callbacks/master/deploy/56_set_server_provider_after_deploy.rb
kontena-cli-1.1.2.rc2 lib/kontena/callbacks/master/deploy/56_set_server_provider_after_deploy.rb
kontena-cli-1.1.2.rc1 lib/kontena/callbacks/master/deploy/56_set_server_provider_after_deploy.rb
kontena-cli-1.1.1 lib/kontena/callbacks/master/deploy/56_set_server_provider_after_deploy.rb
kontena-cli-1.1.1.rc1 lib/kontena/callbacks/master/deploy/56_set_server_provider_after_deploy.rb
kontena-cli-1.1.0 lib/kontena/callbacks/master/deploy/56_set_server_provider_after_deploy.rb
kontena-cli-1.1.0.rc2 lib/kontena/callbacks/master/deploy/56_set_server_provider_after_deploy.rb
kontena-cli-1.1.0.rc1 lib/kontena/callbacks/master/deploy/56_set_server_provider_after_deploy.rb
kontena-cli-1.1.0.pre1 lib/kontena/callbacks/master/deploy/56_set_server_provider_after_deploy.rb