cfhighlander 0.5.0.alpha.1535961584 → 0.5.0.alpha.1537147173
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/cfhighlander.compiler.rb +15 -15
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 41073522bcd861a485c15c48e881dd8d3ae76b48a87bab8240e1a25cf0fcdfde
|
4
|
+
data.tar.gz: df1b2985dbe87bf7f0d9cb437a2d6a07b86c51c75a58a58b8c0854e382ad72df
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7d4ade8ff6b63fc87256734baa871de41831c4359c5f6d46c2081d8ed14fe8d72bf920106039c1b5f45a33582160971ee13d99c02ea74ffa59ebd099b04213a3
|
7
|
+
data.tar.gz: be33f86e7b640ffcc1a399278fe030ec255b7b97b2225b63ccc74d1064fea7cb5cac7a0fe25269b0c3dc33a4400dcfa7b896c4891f424c9ceecec6793971fc7e
|
@@ -246,41 +246,41 @@ module Cfhighlander
|
|
246
246
|
FileUtils.remove full_destination_path if File.exist? full_destination_path
|
247
247
|
|
248
248
|
# download file if code remote archive
|
249
|
-
puts "
|
250
|
-
puts "Destination
|
249
|
+
puts "INFO | Lambda #{name} | Start package process"
|
250
|
+
puts "INFO | Lambda #{name} | Destination is #{full_destination_path}"
|
251
251
|
|
252
252
|
md5 = Digest::MD5.new
|
253
253
|
md5.update lambda_config['code']
|
254
254
|
hash = md5.hexdigest
|
255
|
-
cached_location = "#{
|
255
|
+
cached_location = "#{ENV['HOME']}/cfhighlander/.cache/lambdas/#{hash}"
|
256
256
|
if cached_downloads.key? lambda_config['code']
|
257
|
-
puts "Using already downloaded archive #{lambda_config['code']}"
|
257
|
+
puts "INFO | Lambda #{name} | Using already downloaded archive #{lambda_config['code']}"
|
258
258
|
FileUtils.copy(cached_downloads[lambda_config['code']], full_destination_path)
|
259
259
|
elsif File.file? cached_location
|
260
|
-
puts "Using
|
260
|
+
puts "INFO | Lambda #{name} | Using cache from #{cached_location}"
|
261
261
|
FileUtils.copy(cached_location, full_destination_path)
|
262
262
|
else
|
263
263
|
if lambda_config['code'].include? 'http'
|
264
|
-
puts "INFO
|
264
|
+
puts "INFO | Lambda #{name} | Downloading source from #{lambda_config['code']}"
|
265
265
|
download = open(lambda_config['code'])
|
266
266
|
IO.copy_stream(download, "#{out_folder}/src.zip")
|
267
|
-
FileUtils.mkdir_p('
|
267
|
+
FileUtils.mkdir_p("#{ENV['HOME']}/cfhighlander/.cache/lambdas")
|
268
268
|
FileUtils.copy("#{out_folder}/src.zip", cached_location)
|
269
269
|
FileUtils.copy("#{out_folder}/src.zip", full_destination_path)
|
270
|
-
puts "INFO
|
270
|
+
puts "INFO | Lambda #{name} | source cached to #{cached_location}"
|
271
271
|
cached_downloads[lambda_config['code']] = cached_location
|
272
272
|
elsif lambda_config['code'].include? 's3://'
|
273
273
|
parts = lambda_config['code'].split('/')
|
274
274
|
if parts.size < 4
|
275
|
-
STDERR.puts "ERROR
|
275
|
+
STDERR.puts "ERROR | Lambda #{name} | Lambda function source code from s3 should be in s3://bucket/path format"
|
276
276
|
exit -8
|
277
277
|
end
|
278
278
|
bucket = parts[2]
|
279
279
|
key = parts.drop(3).join('/')
|
280
280
|
s3 = Aws::S3::Client.new({ region: s3_bucket_region(bucket) })
|
281
|
-
puts "INFO
|
281
|
+
puts "INFO | Lambda #{name} | Downloading source from #{lambda_config['code']}"
|
282
282
|
s3.get_object({ bucket: bucket, key: key, response_target: cached_location })
|
283
|
-
puts "INFO
|
283
|
+
puts "INFO | Lambda #{name} | source cached to #{cached_location}"
|
284
284
|
FileUtils.copy(cached_location, full_destination_path)
|
285
285
|
cached_downloads[lambda_config['code']] = cached_location
|
286
286
|
else
|
@@ -297,7 +297,7 @@ module Cfhighlander
|
|
297
297
|
component_dir = nil unless parent_exists
|
298
298
|
end
|
299
299
|
if component_dir.nil?
|
300
|
-
STDERR.puts "ERROR
|
300
|
+
STDERR.puts "ERROR | Lambda #{name} | Could not find source code directory in component #{@component.name}"
|
301
301
|
exit -9
|
302
302
|
end
|
303
303
|
|
@@ -316,7 +316,7 @@ module Cfhighlander
|
|
316
316
|
|
317
317
|
# Lambda function source code allows pre-processing (e.g. install code dependencies)
|
318
318
|
unless lambda_config['package_cmd'].nil?
|
319
|
-
puts "Following code will be executed to generate lambda function #{name}:\n\n#{lambda_config['package_cmd']}\n\n"
|
319
|
+
puts "INFO | Lambda #{name} | Following code will be executed to generate lambda function #{name}:\n\n#{lambda_config['package_cmd']}\n\n"
|
320
320
|
|
321
321
|
if @confirm_code_execution
|
322
322
|
exit -7 unless HighLine.agree('Proceed (y/n)?')
|
@@ -326,7 +326,7 @@ module Cfhighlander
|
|
326
326
|
puts 'Processing package command...'
|
327
327
|
package_result = system(package_cmd)
|
328
328
|
unless package_result
|
329
|
-
puts "
|
329
|
+
puts "ERROR | Lambda #{name} | create package - following command failed\n\n#{package_cmd}\n\n"
|
330
330
|
exit -4
|
331
331
|
end
|
332
332
|
end
|
@@ -342,7 +342,7 @@ module Cfhighlander
|
|
342
342
|
end
|
343
343
|
sha256 = Digest::SHA256.file full_destination_path
|
344
344
|
sha256 = sha256.base64digest
|
345
|
-
puts "
|
345
|
+
puts "INFO | Lambda #{name} | Created zip package #{full_destination_path} with digest #{sha256}"
|
346
346
|
@metadata['sha256'][name] = sha256
|
347
347
|
@metadata['version'][name] = timestamp
|
348
348
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cfhighlander
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.5.0.alpha.
|
4
|
+
version: 0.5.0.alpha.1537147173
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Nikola Tosic
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2018-09-
|
13
|
+
date: 2018-09-17 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: highline
|