lambda-layer-cake 0.1.4 → 0.2.0

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: 4a7df28b79c0ce60e8737a4a45135f7de87b9c4354049077616f96baf0f2edb2
4
- data.tar.gz: 6cf0b6cc2ad3aac39f6c1d3f6812cae782909de8bce0719ba6d257890b3ebe54
3
+ metadata.gz: ad779537dd417dd3ddb16ca96ece7692dbf38aedff64ee95ae37a712b0fd5d33
4
+ data.tar.gz: 3330511939df7a90a960711dc55bddd7e3f13ee187d0020febcba01ca7293f98
5
5
  SHA512:
6
- metadata.gz: 62fe0a8519ab090610ec6dae870a297f2f55bf934db7eceee31e2a08ece111b4b0d10e14fe387c45b43e01f0d56fbdbe2a2e6d6139b9640bdbf903db341bd845
7
- data.tar.gz: 967a2998de8b6ae61cdd200d583e12193a78f71c3ba9377571d99f3e1edac2d30d60eb4b7f01d1130c816706d1b3dd85468f8ee010e55f271303e0b13b7f5642
6
+ metadata.gz: a38a3e6ea2694cb6de54d490d940529c498bfb2f6b3f5974f6c3f89487aedec0e7e2d8855a1cf16b19ae4f9f9fb5e53d45027a833c8d4b2930a96b4895922523
7
+ data.tar.gz: 99b148c4bc9f65e3c911a42a1b4be725bd3aa5fb2c2abe18918a9c5413ac6a431012899f4084c5b70a9b53ba9d9c873328da6426f923b8dbd541710013c4098d
@@ -18,6 +18,7 @@ def main
18
18
  if(File.exist?('system-packages.txt'))
19
19
  STDERR.puts("Installing System Packages")
20
20
  build_deps = File.read("system-packages.txt").split
21
+ STDERR.puts("Packages: #{build_deps.join(',')}")
21
22
  unless(system("yum", "install", "-y", *(build_deps)))
22
23
  STDERR.puts("Could not install build dependency pacakges")
23
24
  exit 2
@@ -67,7 +68,7 @@ def main
67
68
  FileUtils.cp(libs.to_a, '/tmp/outputs/lib')
68
69
 
69
70
  #This directory is not needed at runtime
70
- STDERR.puts("Removing extra files")
71
+ STDERR.puts("Removing extra files (skipping)")
71
72
  FileUtils.rm_rf("/tmp/build/bundle/ruby/2.5.0/cache")
72
73
 
73
74
  STDERR.puts("Moving Bundle into place")
@@ -26,7 +26,7 @@ module LambdaLayerCake
26
26
  -v #{inputs_dir}:/tmp/inputs
27
27
  -v #{outputs_dir}:/tmp/outputs
28
28
  -v #{File.expand_path(__dir__ + "/../../build_env")}:/var/task
29
- lambci/lambda:build-ruby2.5 ruby build_ruby.rb}
29
+ lambci/lambda:#{docker_tag} ruby build_ruby.rb}
30
30
  STDERR.puts("Excuting cmd: #{cmd.join(' ')}")
31
31
  system(*cmd) or raise
32
32
  end
@@ -55,7 +55,7 @@ module LambdaLayerCake
55
55
  desc "Build the current layer version and symlink it to the versioned zip"
56
56
  file ".layer_cake/layer.zip": ".layer_cake/layer-#{input_hash}.zip" do
57
57
  FileUtils.ln_s("layer-#{input_hash}.zip",".layer_cake/layer.zip", force: true)
58
- end
58
+ end
59
59
  end
60
60
 
61
61
  def app_task_definitions!
@@ -81,7 +81,13 @@ module LambdaLayerCake
81
81
  desc "Output the version hash for the current input files (Gemfile, Gemfile.lock, system-packages.txt)"
82
82
  task :version do
83
83
  $stdout.write input_hash
84
- end
84
+ end
85
+
86
+ desc "Reports the ruby version of the lambda environment"
87
+ task :ruby_version do
88
+ $stdout.write ruby_version
89
+ end
90
+
85
91
  end
86
92
 
87
93
  def clean_task_definitions!
@@ -118,5 +124,19 @@ module LambdaLayerCake
118
124
  )
119
125
  )
120
126
  end
127
+
128
+ def docker_tag
129
+ "build-ruby#{/^\d+\.\d+/.match(RUBY_VERSION)[0]}"
130
+ end
131
+
132
+ def ruby_version
133
+ cmd = %W{docker run --rm
134
+ -v #{inputs_dir}:/tmp/inputs
135
+ -v #{outputs_dir}:/tmp/outputs
136
+ -v #{File.expand_path(__dir__ + "/../../build_env")}:/var/task
137
+ lambci/lambda:#{docker_tag} ruby -e }.push '$stdout.write RUBY_VERSION'
138
+ STDERR.puts("Excuting cmd: #{cmd.join(' ')}")
139
+ system(*cmd) or raise
140
+ end
121
141
  end
122
142
  end
@@ -1,3 +1,3 @@
1
1
  module LambdaLayerCake
2
- VERSION = '0.1.4'
2
+ VERSION = '0.2.0'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lambda-layer-cake
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.4
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Logan Bowers
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-10-11 00:00:00.000000000 Z
11
+ date: 2020-07-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rspec
@@ -73,7 +73,7 @@ homepage: http://github.com/loganb/lambda-layer-cake
73
73
  licenses:
74
74
  - MIT
75
75
  metadata: {}
76
- post_install_message:
76
+ post_install_message:
77
77
  rdoc_options: []
78
78
  require_paths:
79
79
  - lib
@@ -88,9 +88,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
88
88
  - !ruby/object:Gem::Version
89
89
  version: '0'
90
90
  requirements: []
91
- rubyforge_project:
92
- rubygems_version: 2.7.10
93
- signing_key:
91
+ rubygems_version: 3.1.2
92
+ signing_key:
94
93
  specification_version: 4
95
94
  summary: A set of Rake tasks to bundle Rails apps for use on AWS Lambda
96
95
  test_files: []