funktor 0.2.3 → 0.2.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 700b659a76af0a0e7e6a21c91a91553f4d5ff5899140ef18313bd181d97de4e1
4
- data.tar.gz: f9d311402f6a0686e11c0d30131135fc5372bf58cc8e6c32c0f5a90f649861d7
3
+ metadata.gz: 666c2af44a969a861936755046fdb067cd118f5c1c197673d3eaf9848a88a3a0
4
+ data.tar.gz: d3a6282e200730a25192d6030f3c28876d10cc6d2b8895797dcf51033605e2c7
5
5
  SHA512:
6
- metadata.gz: 47e9682f6d0f96e9ce5d393574642b8361049c91f07dc2b9154c4492c0b10257bc651e22ea5512a1f904cd2a895c9435d9722c559b756086618f1ea58983298a
7
- data.tar.gz: a498a2854d47e3c2b0bfd9f1bb2d2feb31b5bd3b8ac1f34c79a5efd127cb81d77862147cd6d27528589710676b748bd744bdd3ace35ebfdb118d4983a3414ac0
6
+ metadata.gz: acfa560d423d17f40e94d6605e7915b4bb2c9f8f1e52530735cf8be887451fa4990f986f8f7a314c43ce38e9d03771c9e33c6d311270dc9a18201aa2ea1760f7
7
+ data.tar.gz: abfa953bfc26962c069839a152cb05616cabb5ac8035760210fd0b815bd2efed13f1ffb597f5f027eda71d95f4a4dcc82de3c618d5b2e059aacca1d8dcb433a7
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- funktor (0.2.3)
4
+ funktor (0.2.4)
5
5
  activesupport
6
6
  aws-sdk-sqs (~> 1.37)
7
7
  thor
@@ -30,9 +30,7 @@ module Funktor
30
30
  name
31
31
  end
32
32
 
33
- def serverless_yml
34
- template "serverless.yml", File.join("serverless.yml")
35
- end
33
+
36
34
 
37
35
  def funktor_config_yml
38
36
  #template "funktor_config.yml", File.join("funktor_config.yml")
@@ -54,6 +52,10 @@ module Funktor
54
52
  template "gitignore", File.join(".gitignore")
55
53
  end
56
54
 
55
+ def workers
56
+ template File.join("app", "workers", "hello_worker.rb"), File.join("app", "workers", "hello_worker.rb")
57
+ end
58
+
57
59
  def resources
58
60
  template File.join("config", "resources", "incoming_job_queue.yml"), File.join("config", "resources", "incoming_job_queue.yml")
59
61
  template File.join("config", "resources", "incoming_job_queue_user.yml"), File.join("config", "resources", "incoming_job_queue_user.yml")
@@ -94,11 +96,34 @@ module Funktor
94
96
  end
95
97
  end
96
98
 
97
- def workers
98
- template File.join("app", "workers", "hello_worker.rb"), File.join("app", "workers", "hello_worker.rb")
99
+ def serverless_yml
100
+ template "serverless.yml", File.join("serverless.yml")
99
101
  end
100
102
 
101
103
  private
104
+
105
+ def app_worker_names
106
+ app_worker_files.map do |file|
107
+ File.basename(file, ".rb").camelize
108
+ end
109
+ end
110
+
111
+ def app_worker_files
112
+ Dir.glob(File.join('app', 'workers', '**.rb'))
113
+ end
114
+
115
+ def all_iam_permissions
116
+ Dir.glob(File.join('config', 'iam_permissions', '**.yml'))
117
+ end
118
+
119
+ def all_function_definitions
120
+ Dir.glob(File.join('config', 'function_definitions', '**.yml'))
121
+ end
122
+
123
+ def all_resources
124
+ Dir.glob(File.join('config', 'resources', '**.yml'))
125
+ end
126
+
102
127
  def funktor_config
103
128
  @funktor_config ||= YAML.load_file options[:file]
104
129
  end
@@ -107,6 +132,10 @@ module Funktor
107
132
  funktor_config["appName"]
108
133
  end
109
134
 
135
+ def app_name
136
+ funktor_config["appName"]
137
+ end
138
+
110
139
  def runtime
111
140
  funktor_config["runtime"]
112
141
  end
@@ -308,10 +308,10 @@ Resources:
308
308
  "type": "metric",
309
309
  "properties": {
310
310
  "metrics": [
311
- [ "rails-lambda-experiment", "Duration", "WorkerClassName", "HelloWorker" ],
312
- [ "...", { "stat": "p99" } ],
313
- [ "...", "HelloLaterWorker" ],
314
- [ "...", { "stat": "p99" } ]
311
+ <%- app_worker_names.each do |worker_name| -%>
312
+ [ "<%= app_name %>", "Duration", "WorkerClassName", "<%= worker_name %>" ],
313
+ [ "...", { "stat": "p99" } ]<%= worker_name == app_worker_names.last ? "" : "," %>
314
+ <%- end -%>
315
315
  ],
316
316
  "view": "timeSeries",
317
317
  "stacked": false,
@@ -27,10 +27,8 @@ provider:
27
27
  environment: ${file(config/environment.yml)}
28
28
  versionFunctions: false # Reduces the amount of storage used since all Lambdas together are limited to 75GB
29
29
  iamRoleStatements:
30
- - ${file(config/iam_permissions/ssm.yml)}
31
- - ${file(config/iam_permissions/incoming_job_queue.yml)}
32
- <%- queue_names.each do |queue_name| -%>
33
- - ${file(config/iam_permissions/<%= queue_name.underscore %>_queue.yml)}
30
+ <%- all_iam_permissions.each do |iam_permission| -%>
31
+ - ${file(<%= iam_permission %>)}
34
32
  <%- end -%>
35
33
 
36
34
 
@@ -44,17 +42,13 @@ custom:
44
42
  package: ${file(config/package.yml)}
45
43
 
46
44
  functions:
47
- incomingJobHandler: ${file(config/function_definitions/incoming_job_handler.yml)}
48
- <%- queue_names.each do |queue_name| -%>
49
- <%= queue_name.camelize %>QueueHandler: ${file(config/function_definitions/<%= queue_name.underscore %>_queue_handler.yml)}
45
+ <%- all_function_definitions.each do |function_definition| -%>
46
+ <%= File.basename(function_definition, ".yml").camelize %>: ${file(<%= function_definition %>)}
50
47
  <%- end -%>
51
48
 
52
49
  resources:
53
- - ${file(config/resources/incoming_job_queue.yml)}
54
- - ${file(config/resources/incoming_job_queue_user.yml)}
55
- - ${file(config/resources/cloudwatch_dashboard.yml)}
56
- <%- queue_names.each do |queue_name| -%>
57
- - ${file(config/resources/<%= queue_name.underscore %>_queue.yml)}
50
+ <%- all_resources.each do |resource| -%>
51
+ - ${file(<%= resource %>)}
58
52
  <%- end -%>
59
53
 
60
54
  plugins:
@@ -1,3 +1,3 @@
1
1
  module Funktor
2
- VERSION = "0.2.3"
2
+ VERSION = "0.2.4"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: funktor
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.3
4
+ version: 0.2.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jeremy Green