Class: RubyYacht::ServerType
- Inherits:
-
Object
- Object
- RubyYacht::ServerType
- 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
-
#baseline_image ⇒ Object
The docker image that we use as the source for the server images.
-
#container_type ⇒ Object
The type of container that this should be applied to.
-
#environment_variables ⇒ Object
The custom environment variables that we set in the images for this server type.
-
#name ⇒ Object
The name of the type.
-
#project_attributes ⇒ Object
The attributes that we define on the project DSL once this server type has been loaded.
-
#server_attributes ⇒ Object
The attributes that we define on the server DSL once this server type has been loaded.
Instance Attribute Details
#baseline_image ⇒ Object
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_type ⇒ Object
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_variables ⇒ Object
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 |
#name ⇒ Object
The name of the type.
11 12 13 |
# File 'lib/ruby_yacht/dsl/server_type.rb', line 11 def name @name end |
#project_attributes ⇒ Object
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_attributes ⇒ Object
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 |