Class: RubyYacht::ServerType

Inherits:
Object
  • Object
show all
Defined in:
lib/ruby_yacht/dsl/server_type.rb

Overview

This class represents a type of server that the user can configure.

An server type corresponds to a major server framework, like Ruby on Rails. Server types are defined by plugins, which also provide the logic for installing and running the server.

You can configure this with RubyYacht::ServerType::DSL

Defined Under Namespace

Classes: DSL

Instance Attribute Summary collapse

Instance Attribute Details

#baseline_imageObject

The docker image that we use as the source for the server images.


45
46
47
# File 'lib/ruby_yacht/dsl/server_type.rb', line 45

def baseline_image
  @baseline_image
end

#container_typeObject

The type of container that this should be applied to.


14
15
16
# File 'lib/ruby_yacht/dsl/server_type.rb', line 14

def container_type
  @container_type
end

#environment_variablesObject

The custom environment variables that we set in the images for this server type.

Each entry will be a hash with the following keys:

  • name: String The name of the environment variable
  • image: String The type of image that this is set in (e.g. server or database).
  • block A block that will be called inside the Dockerfile ERB for providing the value of the environment variable.

58
59
60
# File 'lib/ruby_yacht/dsl/server_type.rb', line 58

def environment_variables
  @environment_variables
end

#nameObject

The name of the type.


11
12
13
# File 'lib/ruby_yacht/dsl/server_type.rb', line 11

def name
  @name
end

#project_attributesObject

The attributes that we define on the project DSL once this server type has been loaded.

Each entry will be a hash with a key for name, and optionally a key for default and required. These values will be given to the add_attribute method in the project DSL.

The attribute names will be prefixed with the server type's name. For instance, if the rails server type provides an environment attribute, it will be called rails_environment on the project's DSL. This prevents conflicts with attributes from other plugins.


27
28
29
# File 'lib/ruby_yacht/dsl/server_type.rb', line 27

def project_attributes
  @project_attributes
end

#server_attributesObject

The attributes that we define on the server DSL once this server type has been loaded.

Each entry will be a hash with a key for name, and optionally a key for default and required. These values will be given to the add_attribute method in the project DSL.

The attributes will only be defined on servers with this server type.

The attribute names will be prefixed with the server type's name. For instance, if the rails server type provides an environment attribute, it will be called rails_environment on the server's DSL. This prevents conflicts with attributes from other plugins.


42
43
44
# File 'lib/ruby_yacht/dsl/server_type.rb', line 42

def server_attributes
  @server_attributes
end