Class: Conjure::Passenger

Inherits:
Object
  • Object
show all
Defined in:
lib/conjure/passenger.rb

Instance Method Summary collapse

Constructor Details

#initialize(container_host, options) ⇒ Passenger

Returns a new instance of Passenger.



7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
# File 'lib/conjure/passenger.rb', line 7

def initialize(container_host, options)
  @container_host = container_host
  @database = options[:database]
  @rails_env = options[:rails_env] || "staging"
  @max_upload_mb = options[:max_upload_mb] || 20
  @system_packages = options[:system_packages] || []
  @ruby_version = options[:ruby_version] || "2.2"
  @rubygems_version = options[:rubygems_version]
  @use_ssl = !!options[:ssl_hostname]
  @ssl_hostname = options[:ssl_hostname] || "unknown"
  @services = options[:services] || []
  @system_packages += ["libsqlite3-dev", "libpq-dev"]
  @system_packages += ["libruby#{@ruby_version}", "ruby#{@ruby_version}"]
  @system_packages += @services.flat_map(&:system_packages)
end

Instance Method Details

#installObject



23
24
25
# File 'lib/conjure/passenger.rb', line 23

def install
  server_template.start(@container_host, "/sbin/my_init", start_options)
end

#pending_filesObject



27
28
29
30
31
32
33
34
35
# File 'lib/conjure/passenger.rb', line 27

def pending_files
  return [] unless @use_ssl
  [
    "/etc/ssl/certs/application.crt",
    "/etc/ssl/certs/root_and_intermediates.crt",
    "/etc/ssl/private/application.key",
    "/etc/ssl/dhparam.pem",
  ]
end