Class: Kitchen::Driver::Marathon

Inherits:
SSHBase
  • Object
show all
Defined in:
lib/kitchen/driver/marathon.rb

Overview

Marathon driver for Kitchen.

Author:

Instance Method Summary collapse

Constructor Details

#initialize(config = {}) ⇒ Marathon

Creates a new Driver object using the provided configuration data which will be merged with any default configuration.

Parameters:

  • config (Hash) (defaults to: {})

    provided driver configuration



64
65
66
67
68
69
70
# File 'lib/kitchen/driver/marathon.rb', line 64

def initialize(config = {})
  # Let our parent do its work
  super(config)

  # Initialize marathon
  initialize_marathon
end

Instance Method Details

#converge(state) ⇒ Object



88
89
90
91
92
93
# File 'lib/kitchen/driver/marathon.rb', line 88

def converge(state)
  # Update the app state
  update_app_state(state)

  super(state)
end

#create(state) ⇒ Object



72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
# File 'lib/kitchen/driver/marathon.rb', line 72

def create(state)
  return if state[:app_id]

  # Generate the application configuration
  app_config = generate_app_config

  # Create the app
  state[:app_id] = create_app(app_config)

  # Wait for the apps deployment to finish
  wait_for_app_deployment(app_config)

  # Update state
  update_app_state(state)
end

#destroy(state) ⇒ Object



95
96
97
98
99
100
101
# File 'lib/kitchen/driver/marathon.rb', line 95

def destroy(state)
  return if state[:app_id].nil?

  destroy_app(state[:app_id])

  state.delete(:app_id)
end

#setup(state) ⇒ Object



103
104
105
106
107
108
# File 'lib/kitchen/driver/marathon.rb', line 103

def setup(state)
  # Update the app state
  update_app_state(state)

  super(state)
end

#verify(state) ⇒ Object



110
111
112
113
114
115
# File 'lib/kitchen/driver/marathon.rb', line 110

def verify(state)
  # Update the app state
  update_app_state(state)

  super(state)
end