Class: Hako::Front

Inherits:
Container show all
Defined in:
lib/hako/front.rb

Direct Known Subclasses

Hako::Fronts::Nginx

Defined Under Namespace

Classes: S3Config

Constant Summary collapse

['app:app'].freeze

Instance Attribute Summary collapse

Attributes inherited from Container

#definition

Instance Method Summary collapse

Methods inherited from Container

#mount_points

Constructor Details

#initializeFront

Returns a new instance of Front.



24
25
26
27
# File 'lib/hako/front.rb', line 24

def initialize(*)
  super
  @s3 = S3Config.new(@definition.fetch('s3'))
end

Instance Attribute Details

#s3Object (readonly)

Returns the value of attribute s3.



22
23
24
# File 'lib/hako/front.rb', line 22

def s3
  @s3
end

Instance Method Details

#envObject



29
30
31
32
33
34
35
# File 'lib/hako/front.rb', line 29

def env
  super.merge(
    'AWS_DEFAULT_REGION' => @s3.region,
    'S3_CONFIG_BUCKET' => @s3.bucket,
    'S3_CONFIG_KEY' => @s3.key(@app.id),
  )
end

#extraObject



43
44
45
# File 'lib/hako/front.rb', line 43

def extra
  @definition.fetch('extra', {})
end

#generate_config(_app_port) ⇒ Object

Raises:

  • (NotImplementedError)


47
48
49
# File 'lib/hako/front.rb', line 47

def generate_config(_app_port)
  raise NotImplementedError
end


39
40
41
# File 'lib/hako/front.rb', line 39

def links
  DEFAULT_LINK + super
end