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.



51
52
53
# File 'lib/ruby_yacht/dsl/server_type.rb', line 51

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

#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

#server_defaultsObject

The default values for the servers with this server type.

Each entry will be a hash where the keys are the names of attributes, and the values are the default values.



48
49
50
# File 'lib/ruby_yacht/dsl/server_type.rb', line 48

def server_defaults
  @server_defaults
end