Class: ChatopsDeployer::Container

Inherits:
Object
  • Object
show all
Includes:
Logger
Defined in:
lib/chatops_deployer/container.rb

Defined Under Namespace

Classes: Error

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Logger

included, #logger, #logger=

Constructor Details

#initialize(project) ⇒ Container

Returns a new instance of Container.



13
14
15
16
17
# File 'lib/chatops_deployer/container.rb', line 13

def initialize(project)
  @sha1 = project.sha1
  @urls = {}
  @project = project
end

Instance Attribute Details

#urlsObject (readonly)

Returns the value of attribute urls.



12
13
14
# File 'lib/chatops_deployer/container.rb', line 12

def urls
  @urls
end

Instance Method Details

#buildObject



19
20
21
22
23
24
25
# File 'lib/chatops_deployer/container.rb', line 19

def build
  @config = @project.config
  create_docker_machine
  setup_docker_environment
  docker_compose_run_commands
  docker_compose_up
end

#destroyObject



27
28
29
30
# File 'lib/chatops_deployer/container.rb', line 27

def destroy
  raise_error("Cannot destroy VM because it doesn't exist") unless vm_exists?
  destroy_vm
end