jets 0.5.4 → 0.5.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +5 -0
- data/Gemfile.lock +1 -1
- data/lib/jets/builders/code_builder.rb +40 -2
- data/lib/jets/builders/node-shim.js +6 -3
- data/lib/jets/cfn/ship.rb +2 -0
- data/lib/jets/commands/templates/skeleton/.gitignore +1 -1
- data/lib/jets/ruby_server.rb +1 -1
- data/lib/jets/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f1ab6e5098560d1702587c1b6b7f49e9f6d2a315f48122de5090c372df485aa8
|
4
|
+
data.tar.gz: 5e5ac74eac851362e414c1e4f85127a88cbac2cb161a2fcbfb19bd933bf311b1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 386a5732285bd3aea9ddf3b47d5873e09a168aec0c88f247eb82dcd14a3d9a3b6d63137f61b1c630f82d93346d15231bedaa5aaf3b944397c60f913a808fe27f
|
7
|
+
data.tar.gz: 771b40cc30dafc61600e0a15e0a85aafd68a69a1cca808bcb86d18646e60769a3ad27be938acaac8c360aebeb2d8adeb898d8540be7d1c4c723f828677cfd582
|
data/CHANGELOG.md
CHANGED
@@ -3,6 +3,11 @@
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
4
4
|
This project *tries* to adhere to [Semantic Versioning](http://semver.org/), even before v1.0.
|
5
5
|
|
6
|
+
## [0.5.5]
|
7
|
+
- clean old git submodules from cache to reduce cache bloat
|
8
|
+
- dont prewarm after deploy if disabled :pull request #12
|
9
|
+
- update docs
|
10
|
+
|
6
11
|
## [0.5.4]
|
7
12
|
- add route check before cloudformation update: pull request #11
|
8
13
|
- hide confusing debugging logs for node shim for user
|
data/Gemfile.lock
CHANGED
@@ -4,6 +4,7 @@ require "colorize"
|
|
4
4
|
require "socket"
|
5
5
|
require "net/http"
|
6
6
|
require "action_view"
|
7
|
+
require "bundler" # for clean_old_submodules only
|
7
8
|
|
8
9
|
# Some important folders to help understand how jets builds a project:
|
9
10
|
#
|
@@ -72,7 +73,7 @@ class Jets::Builders
|
|
72
73
|
Dir.chdir(full(tmp_app_root)) do
|
73
74
|
# These commands run from project root
|
74
75
|
start_app_root_setup
|
75
|
-
|
76
|
+
bundle
|
76
77
|
finish_app_root_setup
|
77
78
|
create_zip_file
|
78
79
|
end
|
@@ -301,6 +302,12 @@ EOL
|
|
301
302
|
end
|
302
303
|
time :create_zip_file
|
303
304
|
|
305
|
+
def bundle
|
306
|
+
clean_old_submodules
|
307
|
+
bundle_install
|
308
|
+
end
|
309
|
+
time :bundle
|
310
|
+
|
304
311
|
# Installs gems on the current target system: both compiled and non-compiled.
|
305
312
|
# If user is on a macosx machine, macosx gems will be installed.
|
306
313
|
# If user is on a linux machine, linux gems will be installed.
|
@@ -330,7 +337,38 @@ EOL
|
|
330
337
|
|
331
338
|
puts 'Bundle install success.'
|
332
339
|
end
|
333
|
-
|
340
|
+
|
341
|
+
# When using submodules, bundler leaves old submodules behind. Over time this inflates
|
342
|
+
# the size of the the bundled gems. So we'll clean it up.
|
343
|
+
def clean_old_submodules
|
344
|
+
lockfile = "#{cache_area}/Gemfile.lock"
|
345
|
+
# https://stackoverflow.com/questions/38800129/parsing-a-gemfile-lock-with-bundler
|
346
|
+
parser = Bundler::LockfileParser.new(Bundler.read_file(Bundler.default_lockfile))
|
347
|
+
specs = parser.specs
|
348
|
+
|
349
|
+
# specs = Bundler.load.specs
|
350
|
+
# IE: spec.source.to_s: "https://github.com/tongueroo/webpacker.git (at jets@a8c4661)"
|
351
|
+
submoduled_specs = specs.select do |spec|
|
352
|
+
spec.source.to_s =~ /@\w+\)/
|
353
|
+
end
|
354
|
+
|
355
|
+
# find git shas to keep
|
356
|
+
# IE: ["a8c4661", "abc4661"]
|
357
|
+
git_shas = submoduled_specs.map do |spec|
|
358
|
+
md = spec.source.to_s.match(/@(\w+)\)/)
|
359
|
+
git_sha = md[1]
|
360
|
+
end
|
361
|
+
puts "git_shas #{git_shas.inspect}"
|
362
|
+
|
363
|
+
# IE: /tmp/jets/demo/cache/bundled/gems/ruby/2.5.0/bundler/gems/webpacker-a8c46614c675
|
364
|
+
Dir.glob("#{cache_area}/bundled/gems/ruby/2.5.0/bundler/gems/*").each do |path|
|
365
|
+
sha = path.split('-').last[0..6] # only first 7 chars of the git sha
|
366
|
+
unless git_shas.include?(sha)
|
367
|
+
puts "Removing old submoduled gem: #{path}"
|
368
|
+
FileUtils.rm_rf(path) # REMOVE old submodule directory
|
369
|
+
end
|
370
|
+
end
|
371
|
+
end
|
334
372
|
|
335
373
|
def copy_gemfiles
|
336
374
|
FileUtils.mkdir_p(cache_area)
|
@@ -124,13 +124,16 @@ function request(event, handler, callback) {
|
|
124
124
|
});
|
125
125
|
|
126
126
|
client.on('error', function(error) {
|
127
|
-
log("Socket error
|
127
|
+
log("Socket error:");
|
128
|
+
log(error);
|
128
129
|
log("Retrying request");
|
129
130
|
setTimeout(function() {
|
130
131
|
if (fs.existsSync(TMP_LOG_PATH)) {
|
131
132
|
var contents = fs.readFileSync(TMP_LOG_PATH, 'utf8');
|
132
|
-
|
133
|
-
|
133
|
+
if (contents != "") {
|
134
|
+
log("subprocess output:", "debug");
|
135
|
+
log(contents, "debug");
|
136
|
+
}
|
134
137
|
}
|
135
138
|
request(event, handler, callback);
|
136
139
|
}, 500);
|
data/lib/jets/cfn/ship.rb
CHANGED
@@ -83,6 +83,8 @@ class Jets::Cfn
|
|
83
83
|
|
84
84
|
def prewarm
|
85
85
|
return unless @options[:stack_type] == :full # s3 bucket is available
|
86
|
+
return unless Jets.config.prewarm.enable
|
87
|
+
|
86
88
|
puts "Prewarming application..."
|
87
89
|
if Jets::PreheatJob::CONCURRENCY > 1
|
88
90
|
Jets::PreheatJob.perform_now(:torch, {quiet: true})
|
data/lib/jets/ruby_server.rb
CHANGED
@@ -43,7 +43,7 @@ module Jets
|
|
43
43
|
def serve
|
44
44
|
# child process
|
45
45
|
server = TCPServer.new(8080) # Server bind to port 8080
|
46
|
-
puts "Ruby server started on port #{PORT}"
|
46
|
+
puts "Ruby server started on port #{PORT}" if ENV['FOREGROUND'] || ENV['JETS_DEBUG'] || ENV['C9_USER']
|
47
47
|
input_completed = false
|
48
48
|
loop do
|
49
49
|
event, handler = nil, nil
|
data/lib/jets/version.rb
CHANGED