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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: b66e14a89144e856046276ece5c9be8754f96d53
4
- data.tar.gz: 5b885cb46bc35871cb881a96e0a70c398f2e2533
3
+ metadata.gz: 20602d917ac3cb556452c15102b7e0263fd8d4da
4
+ data.tar.gz: 62c6903344a718734c9d8dc49fe30d7b64b302fd
5
5
  SHA512:
6
- metadata.gz: 821358cfa85d1f840c7014c72a52371bc2319b23a630e76117ed4a156b3da6bdcd6c80dc745199802ded875b708d406c73e875df2bc8f5cf36086d6c782e392d
7
- data.tar.gz: a8adfa5b49f154c6ae97722becb755aa071f3d552838c5f1e971aed1aba7cd22c6752485809b01bb76daa0cefaba533d5985847e3dd09ebd1ec9c77a5c41acda
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 role.
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 role tenemos que sustituirlo por el que corresponda de los que nos devuelve AWS:
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
 
@@ -6,6 +6,7 @@ load "lib/tasks/lambdas.rake"
6
6
 
7
7
  namespace :lambdas do
8
8
  Rake::TestTask.new(:test) do |t|
9
+ t.description = "Run all lambdas' tests"
9
10
  t.libs = %w(lib)
10
11
  t.pattern = "lambdas/test.rb"
11
12
  end
@@ -9,7 +9,7 @@ module Tck
9
9
  attr_reader :conf
10
10
 
11
11
  def self.tmpdir
12
- @tmpdir ||= Dir.tmpdir + "/tck_lambdas"
12
+ @tmpdir ||= Dir.tmpdir + "/tck-lambdas"
13
13
  end
14
14
 
15
15
  def self.yaml
@@ -1,9 +1,29 @@
1
1
  namespace :lambdas do
2
2
  namespace :<%= @lambda.name %> do
3
- task test: "lambdas:test"
3
+ desc "Upload tests lambda, run tests, read emails..."
4
+ task build_lambda: [
5
+ :upload_test,
6
+ :test
7
+ ]
4
8
 
5
- desc "Update the <%= @lambda.name %> lambda code (creating & uploading the ZIP file)"
6
- task upload_zip: :create_zip do
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 w/ source/* code"
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}..."
@@ -5,7 +5,7 @@ require_relative "../lib/tck/lambdas/aws_function"
5
5
 
6
6
  Tck::Lambdas::AwsFunction.clean_tmps!
7
7
 
8
- Dir['lambdas/*/'].each do |directory|
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
@@ -1,5 +1,5 @@
1
1
  module Tck
2
2
  module Lambdas
3
- VERSION = "0.1.3"
3
+ VERSION = "0.1.4"
4
4
  end
5
5
  end
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.3
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-09 00:00:00.000000000 Z
11
+ date: 2016-07-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: thor