Class: Mxrb::Runtime::DockerWorkspace

Inherits:
Object
  • Object
show all
Defined in:
lib/mxrb/runtime/docker_workspace.rb

Overview

Produces the argv-safe command for a natively compiled Runtime package.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(project_path, plan, workspace_size: "8g") ⇒ DockerWorkspace

Returns a new instance of DockerWorkspace.



9
10
11
12
13
# File 'lib/mxrb/runtime/docker_workspace.rb', line 9

def initialize(project_path, plan, workspace_size: "8g")
  @project_path = File.expand_path(project_path)
  @plan = plan
  @workspace_size = workspace_size.to_s
end

Instance Attribute Details

#planObject (readonly)

Returns the value of attribute plan.



7
8
9
# File 'lib/mxrb/runtime/docker_workspace.rb', line 7

def plan
  @plan
end

#project_pathObject (readonly)

Returns the value of attribute project_path.



7
8
9
# File 'lib/mxrb/runtime/docker_workspace.rb', line 7

def project_path
  @project_path
end

Instance Method Details

#runtime_command(package_volume:, http_port: 8080, admin_port: 8090) ⇒ Object



15
16
17
18
19
20
21
22
23
24
25
26
# File 'lib/mxrb/runtime/docker_workspace.rb', line 15

def runtime_command(package_volume:, http_port: 8080, admin_port: 8090)
  [
    "docker", "run", "--rm",
    "--mount", "type=volume,source=#{package_volume},target=/mendix",
    "--tmpfs", "/mendix/data:exec,size=2g",
    "-p", "#{Integer(http_port)}:8080",
    "-p", "#{Integer(admin_port)}:8090",
    "-e", "M2EE_ADMIN_PASS=mxrb-functional-test",
    @plan.runtime_image,
    "./bin/start", "etc/Default"
  ]
end