Skip to content

Commit 1fd7e42

Browse files
Improve elasticbeanstalk debugging
Don't print a line for every file, which may blow out if a node_modules or similar is included. Add logging around zip file size. Add logging around S3 upload / EB version registration
1 parent 6cf0f29 commit 1fd7e42

1 file changed

Lines changed: 10 additions & 1 deletion

File tree

lib/dpl/providers/elasticbeanstalk.rb

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,20 +89,29 @@ def zip_exists?
8989

9090
def create_zip
9191
::Zip::File.open(zip_file, ::Zip::File::CREATE) do |zip|
92+
n_files = 0
9293
files.each do |path|
93-
debug :zip_add, path
94+
n_files++
9495
zip.add(path.sub(cwd, ''), path)
9596
end
97+
debug "Zip contains #{n_files} files"
98+
size = File.size(zip_file)
99+
warn "Zip file is empty." if size == 0
100+
# https://docs.aws.amazon.com/elasticbeanstalk/latest/dg/applications-versions.html
101+
warn "Zip file may be too large." if size > 524288000
102+
debug "Zip file size: #{size.to_f / 2**10}kb"
96103
end
97104
end
98105

99106
def upload
107+
debug "upload zipfile:#{zip_file} bucket path: #{bucket_path}"
100108
@object = bucket.object(bucket_path)
101109
object.put(body: File.open(zip_file))
102110
sleep 5 # s3 eventual consistency
103111
end
104112

105113
def create_version
114+
debug "create_version app:#{app}, label:#{label}, bucket:#{bucket.name}, key:#{object.key}"
106115
@version = eb.create_application_version(
107116
application_name: app,
108117
version_label: label,

0 commit comments

Comments
 (0)