tck-lambdas 0.1.3 → 0.1.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +2 -2
- data/lib/tck/lambdas/Rakefile +1 -0
- data/lib/tck/lambdas/aws_function.rb +1 -1
- data/lib/tck/lambdas/templates/lambdas.rake.erb +24 -4
- data/lib/tck/lambdas/test.rb +1 -1
- data/lib/tck/lambdas/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 20602d917ac3cb556452c15102b7e0263fd8d4da
|
4
|
+
data.tar.gz: 62c6903344a718734c9d8dc49fe30d7b64b302fd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fb87d55d933294f1e6a36e14dc4e107216d4b5a3277104451305664360fe9d70ce3dd3d5c3d6497972c0c365535df2a689efdc5beb43f805fbbd9ccdb74a32c6
|
7
|
+
data.tar.gz: 8cd0bc333a9f8a68604d2e26e26b811774477d4af145d8621cdda8134b8dd109811045f2908563d0e7a52d2e6f893707635e9f207153cdd6cb83823200635b34
|
data/README.md
CHANGED
@@ -38,11 +38,11 @@ Tal y como nos avisa ha creado, entre otras cosas, el fichero *.lambdas.yml* con
|
|
38
38
|
runtime: nodejs4.3
|
39
39
|
role: lambda_contact_form_role
|
40
40
|
|
41
|
-
Todos los valores por defecto deberían ser válidos excepto el nombre de la función (_function-name_), su manejador (_handler_), y su
|
41
|
+
Todos los valores por defecto deberían ser válidos excepto el nombre de la función (_function-name_), su manejador (_handler_), y su rol.
|
42
42
|
|
43
43
|
En el nombre del la función y su manejador tenemos que sustituir *tck_project* por el nombre de nuestro proyecto (quedándonos con *amazing_contact_form* y *amazing_contact_form.handler* respectivamente).
|
44
44
|
|
45
|
-
El
|
45
|
+
El rol tenemos que sustituirlo por el que corresponda de los que nos devuelve AWS:
|
46
46
|
|
47
47
|
aws iam list-roles --query "Roles[].[RoleName,Arn]"
|
48
48
|
|
data/lib/tck/lambdas/Rakefile
CHANGED
@@ -1,9 +1,29 @@
|
|
1
1
|
namespace :lambdas do
|
2
2
|
namespace :<%= @lambda.name %> do
|
3
|
-
|
3
|
+
desc "Upload tests lambda, run tests, read emails..."
|
4
|
+
task build_lambda: [
|
5
|
+
:upload_test,
|
6
|
+
:test
|
7
|
+
]
|
4
8
|
|
5
|
-
desc "
|
6
|
-
task
|
9
|
+
desc "Test <%= @lambda.name %> lambda"
|
10
|
+
task :test do
|
11
|
+
ENV["test_only_one_lambda_directory"] = "<%= @lambda.name %>"
|
12
|
+
Rake::Task["lambdas:test"].invoke
|
13
|
+
end
|
14
|
+
|
15
|
+
desc "Update the <%= @lambda.name %>_test lambda code (creating & uploading the ZIP file)"
|
16
|
+
task upload_test: :create_zip do
|
17
|
+
tck_lambda = Tck::Lambdas::AwsFunction.new(:<%= @lambda.name %>)
|
18
|
+
|
19
|
+
params = "--function-name #{tck_lambda.function_name}_test " <<
|
20
|
+
"--zip-file fileb://#{tck_lambda.zip_file}"
|
21
|
+
|
22
|
+
puts `aws lambda update-function-code #{params}`
|
23
|
+
end
|
24
|
+
|
25
|
+
desc "Update <%= @lambda.function_name %> lambda w/ <%= @lambda.zip_file %> (use :build_lambda first)"
|
26
|
+
task :upload_zip do
|
7
27
|
tck_lambda = Tck::Lambdas::AwsFunction.new(:<%= @lambda.name %>)
|
8
28
|
|
9
29
|
params = "--function-name #{tck_lambda.function_name} " <<
|
@@ -12,7 +32,7 @@ namespace :lambdas do
|
|
12
32
|
puts `aws lambda update-function-code #{params}`
|
13
33
|
end
|
14
34
|
|
15
|
-
desc "Generate lambda's ZIP file
|
35
|
+
desc "Generate lambda's ZIP file with source/* code (use :build_lambda best)"
|
16
36
|
task :create_zip do
|
17
37
|
tck_lambda = Tck::Lambdas::AwsFunction.new(:<%= @lambda.name %>)
|
18
38
|
puts "Creating #{tck_lambda.zip_file}..."
|
data/lib/tck/lambdas/test.rb
CHANGED
@@ -5,7 +5,7 @@ require_relative "../lib/tck/lambdas/aws_function"
|
|
5
5
|
|
6
6
|
Tck::Lambdas::AwsFunction.clean_tmps!
|
7
7
|
|
8
|
-
Dir[
|
8
|
+
Dir["lambdas/#{ENV["test_only_one_lambda_directory"] || '*'}/"].each do |directory|
|
9
9
|
lambda_name = directory[8..-2]
|
10
10
|
|
11
11
|
describe "The Cocktail #{lambda_name} lambda" do
|
data/lib/tck/lambdas/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: tck-lambdas
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Fernando Garcia Samblas
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-07-
|
11
|
+
date: 2016-07-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: thor
|