Class: Jets::Naming

Inherits:
Object
  • Object
show all
Defined in:
lib/jets/naming.rb

Overview

This class groups the naming in one place. Some naming is for CloudFormation Some are for the Build process

Class Method Summary collapse

Class Method Details

.api_deployment_template_pathObject



26
27
28
# File 'lib/jets/naming.rb', line 26

def api_deployment_template_path
  "#{template_path_prefix}-api-deployment.yml"
end

.api_gateway_template_pathObject

consider moving these methods into cfn/builder/helpers.rb or that area.



22
23
24
# File 'lib/jets/naming.rb', line 22

def api_gateway_template_path
  "#{template_path_prefix}-api-gateway.yml"
end

.code_s3_keyObject



38
39
40
41
# File 'lib/jets/naming.rb', line 38

def code_s3_key
  md5_zipfile = File.basename(md5_code_zipfile)
  "jets/code/#{md5_zipfile}"
end

.gateway_api_nameObject



34
35
36
# File 'lib/jets/naming.rb', line 34

def gateway_api_name
  "#{Jets.config.project_namespace}"
end

.md5_code_zipfileObject

build was already ran and that a file that contains the md5 path exists at Jets.build_root/code/current-md5-filename.txt

md5_code_zipfile: /tmp/jets/demo/code/code-2e0e18f6.zip



47
48
49
50
# File 'lib/jets/naming.rb', line 47

def md5_code_zipfile
  path = "#{Jets.build_root}/code/current-md5-filename.txt"
  File.exist?(path) ? IO.read(path) : "current-md5-filename-doesnt-exist"
end

.parent_stack_nameObject



30
31
32
# File 'lib/jets/naming.rb', line 30

def parent_stack_name
  File.basename(parent_template_path, ".yml")
end

.parent_template_pathObject

consider moving these methods into cfn/builder/helpers.rb or that area.



17
18
19
# File 'lib/jets/naming.rb', line 17

def parent_template_path
  "#{template_path_prefix}.yml"
end

.template_path(app_class) ⇒ Object



7
8
9
10
# File 'lib/jets/naming.rb', line 7

def template_path(app_class)
  underscored = app_class.to_s.underscore.gsub('/','-')
  "#{template_path_prefix}-#{underscored}.yml"
end

.template_path_prefixObject



12
13
14
# File 'lib/jets/naming.rb', line 12

def template_path_prefix
  "#{Jets.build_root}/templates/#{Jets.config.project_namespace}"
end