jets 1.3.9 → 1.4.0
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 +3 -3
- data/lib/jets.rb +1 -0
- data/lib/jets/booter.rb +12 -1
- data/lib/jets/builders/code_builder.rb +39 -35
- data/lib/jets/builders/code_size.rb +4 -2
- data/lib/jets/builders/gem_replacer.rb +7 -20
- data/lib/jets/builders/lambda_layer.rb +55 -37
- data/lib/jets/builders/rack_packager.rb +6 -4
- data/lib/jets/builders/ruby_packager.rb +8 -27
- data/lib/jets/builders/shim_vars/base.rb +0 -4
- data/lib/jets/builders/util.rb +6 -7
- data/lib/jets/commands/deploy.rb +1 -2
- data/lib/jets/commands/import/rail.rb +1 -34
- data/lib/jets/core.rb +3 -2
- data/lib/jets/turbo.rb +47 -0
- data/lib/jets/turbo/database_yaml.rb +41 -0
- data/lib/jets/turbo/project/.gitignore +12 -0
- data/lib/jets/turbo/project/.jetskeep +1 -0
- data/lib/jets/turbo/project/Gemfile +16 -0
- data/lib/jets/turbo/project/Gemfile.lock +184 -0
- data/lib/jets/turbo/project/Rakefile +2 -0
- data/lib/jets/turbo/project/app/controllers/application_controller.rb +2 -0
- data/lib/jets/turbo/project/app/helpers/application_helper.rb +2 -0
- data/lib/jets/turbo/project/app/jobs/application_job.rb +4 -0
- data/lib/jets/turbo/project/config.ru +5 -0
- data/lib/jets/turbo/project/config/application.rb +4 -0
- data/lib/jets/turbo/project/config/routes.rb +4 -0
- data/lib/jets/turbo/rail.rb +113 -0
- data/lib/jets/turbo/templates/config/database.yml +26 -0
- data/lib/jets/version.rb +1 -1
- data/vendor/jets-gems/lib/jets/gems/check.rb +18 -9
- data/vendor/jets-gems/lib/jets/gems/extract/gem.rb +1 -1
- metadata +17 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ec914295c99192ef042110202c7ac3161003e644fb73a7b24cc196884d6295ae
|
4
|
+
data.tar.gz: 716b93e31d27fa740b11bfba46db5a5af8b344d0e8877363ad07a49d50728032
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fc7e956e2c6a675fc14d325f3207d10cecb16d29a54e7ef81679de2161feff423055bbef8e0b25071dc059a9c57c4205a5d8d20094d0fe46315deed8b58f8062
|
7
|
+
data.tar.gz: 05067666cbda6be6986a12fc1acd6f757f8c33f8fa12a3debfe7182f72d1b08a17bd7321d0c23a2e2d0f827e19c7b16ea6386a2e4a177d71e66af16b41f42d42
|
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 *loosely tries* to adhere to [Semantic Versioning](http://semver.org/), even before v1.0.
|
5
5
|
|
6
|
+
## [1.4.0]
|
7
|
+
- Afterburner mode: Allows you to deploy from within a Rails app
|
8
|
+
- #110 from tongueroo/jet-pack: Turbo charge mode: enabling afterburner
|
9
|
+
- Afterburner is recommended over Mega Mode.
|
10
|
+
|
6
11
|
## [1.3.9]
|
7
12
|
- #106 from eamsc/sqs-special-map
|
8
13
|
- #107 from eamsc/sqs-resource
|
data/Gemfile.lock
CHANGED
@@ -11,7 +11,7 @@ GIT
|
|
11
11
|
PATH
|
12
12
|
remote: .
|
13
13
|
specs:
|
14
|
-
jets (1.
|
14
|
+
jets (1.4.0)
|
15
15
|
actionpack (>= 5.2.1)
|
16
16
|
actionview (>= 5.2.1)
|
17
17
|
activerecord (>= 5.2.1)
|
@@ -113,7 +113,7 @@ GEM
|
|
113
113
|
gems (1.1.1)
|
114
114
|
json
|
115
115
|
hashie (3.6.0)
|
116
|
-
i18n (1.
|
116
|
+
i18n (1.3.0)
|
117
117
|
concurrent-ruby (~> 1.0)
|
118
118
|
jmespath (1.4.0)
|
119
119
|
json (2.1.0)
|
@@ -123,7 +123,7 @@ GEM
|
|
123
123
|
nokogiri (>= 1.5.9)
|
124
124
|
memoist (0.16.0)
|
125
125
|
method_source (0.9.2)
|
126
|
-
mimemagic (0.3.
|
126
|
+
mimemagic (0.3.3)
|
127
127
|
mini_portile2 (2.4.0)
|
128
128
|
minitest (5.11.3)
|
129
129
|
mysql2 (0.5.2)
|
data/lib/jets.rb
CHANGED
data/lib/jets/booter.rb
CHANGED
@@ -4,8 +4,9 @@ class Jets::Booter
|
|
4
4
|
def boot!(options={})
|
5
5
|
return if @booted
|
6
6
|
|
7
|
+
turbo_charge
|
7
8
|
confirm_jets_project!
|
8
|
-
require_bundle_gems
|
9
|
+
require_bundle_gems unless bypass_bundler_setup?
|
9
10
|
Jets::Dotenv.load!
|
10
11
|
|
11
12
|
Jets.application.setup!
|
@@ -20,6 +21,16 @@ class Jets::Booter
|
|
20
21
|
@booted = true
|
21
22
|
end
|
22
23
|
|
24
|
+
def bypass_bundler_setup?
|
25
|
+
command = ARGV.first
|
26
|
+
%w[build delete deploy].include?(command)
|
27
|
+
end
|
28
|
+
|
29
|
+
def turbo_charge
|
30
|
+
turbo = Jets::Turbo.new
|
31
|
+
turbo.charge
|
32
|
+
end
|
33
|
+
|
23
34
|
# Builds and memoize stack so it only gets built on bootup
|
24
35
|
def build_middleware_stack
|
25
36
|
Jets.application.build_stack
|
@@ -35,7 +35,7 @@ class Jets::Builders
|
|
35
35
|
compile_assets # easier to do before we copy the project because node and yarn has been likely setup in the that dir
|
36
36
|
compile_rails_assets
|
37
37
|
copy_project
|
38
|
-
Dir.chdir(
|
38
|
+
Dir.chdir("#{stage_area}/code") do
|
39
39
|
# These commands run from project root
|
40
40
|
code_setup
|
41
41
|
package_ruby
|
@@ -47,7 +47,7 @@ class Jets::Builders
|
|
47
47
|
# to reference files with the md5 checksum. The files are the:
|
48
48
|
#
|
49
49
|
# jets/code/rack-checksum.zip
|
50
|
-
# jets/code/
|
50
|
+
# jets/code/opt-checksum.zip
|
51
51
|
#
|
52
52
|
# We compute the checksums before we generate the node shim handlers.
|
53
53
|
def calculate_md5s
|
@@ -86,10 +86,6 @@ class Jets::Builders
|
|
86
86
|
end
|
87
87
|
end
|
88
88
|
|
89
|
-
def stage_area
|
90
|
-
"#{Jets.build_root}/stage"
|
91
|
-
end
|
92
|
-
|
93
89
|
def code_setup
|
94
90
|
reconfigure_development_webpacker
|
95
91
|
end
|
@@ -101,19 +97,12 @@ class Jets::Builders
|
|
101
97
|
copy_internal_jets_code
|
102
98
|
|
103
99
|
# Code prep and zipping
|
104
|
-
build_lambda_layer
|
105
100
|
check_code_size!
|
106
101
|
calculate_md5s # must be called before generate_node_shims and create_zip_files
|
107
102
|
generate_node_shims
|
108
103
|
create_zip_files
|
109
104
|
end
|
110
105
|
|
111
|
-
def build_lambda_layer
|
112
|
-
return if Jets.poly_only?
|
113
|
-
lambda_layer = LambdaLayer.new
|
114
|
-
lambda_layer.build
|
115
|
-
end
|
116
|
-
|
117
106
|
def check_code_size!
|
118
107
|
CodeSize.check!
|
119
108
|
end
|
@@ -125,7 +114,7 @@ class Jets::Builders
|
|
125
114
|
files = []
|
126
115
|
files.each do |relative_path|
|
127
116
|
src = File.expand_path("../internal/#{relative_path}", File.dirname(__FILE__))
|
128
|
-
dest = "#{
|
117
|
+
dest = "#{"#{stage_area}/code"}/#{relative_path}"
|
129
118
|
FileUtils.mkdir_p(File.dirname(dest))
|
130
119
|
FileUtils.cp(src, dest)
|
131
120
|
end
|
@@ -145,12 +134,11 @@ class Jets::Builders
|
|
145
134
|
# At this point the minimal stack exists, so we can grab it with the AWS API.
|
146
135
|
# We do not want to grab this as part of the live request because it is slow.
|
147
136
|
def store_s3_base_url
|
148
|
-
write_s3_base_url("config/s3_base_url.txt")
|
149
|
-
write_s3_base_url("rack/config/s3_base_url.txt") if Jets.rack?
|
137
|
+
write_s3_base_url("#{stage_area}/code/config/s3_base_url.txt")
|
138
|
+
write_s3_base_url("#{stage_area}/rack/config/s3_base_url.txt") if Jets.rack?
|
150
139
|
end
|
151
140
|
|
152
|
-
def write_s3_base_url(
|
153
|
-
full_path = "#{full(tmp_code)}/#{relative_path}"
|
141
|
+
def write_s3_base_url(full_path)
|
154
142
|
FileUtils.mkdir_p(File.dirname(full_path))
|
155
143
|
IO.write(full_path, s3_base_url)
|
156
144
|
end
|
@@ -175,7 +163,7 @@ class Jets::Builders
|
|
175
163
|
end
|
176
164
|
|
177
165
|
def disable_webpacker_middleware
|
178
|
-
full_path = "#{
|
166
|
+
full_path = "#{"#{stage_area}/code"}/config/disable-webpacker-middleware.txt"
|
179
167
|
FileUtils.mkdir_p(File.dirname(full_path))
|
180
168
|
FileUtils.touch(full_path)
|
181
169
|
end
|
@@ -212,17 +200,25 @@ class Jets::Builders
|
|
212
200
|
|
213
201
|
return unless Jets.rack?
|
214
202
|
|
203
|
+
# Need to capture JETS_ROOT since can be changed by Turbo mode
|
204
|
+
jets_root = Jets.root
|
215
205
|
Bundler.with_clean_env do
|
216
|
-
|
217
|
-
|
206
|
+
gemfile = ENV['BUNDLE_GEMFILE']
|
207
|
+
ENV['BUNDLE_GEMFILE'] = "#{jets_root}/rack/Gemfile"
|
208
|
+
|
209
|
+
sh "cd #{jets_root} && bundle install"
|
210
|
+
rails_assets(:clobber, jets_root: jets_root)
|
211
|
+
rails_assets(:precompile, jets_root: jets_root)
|
212
|
+
|
213
|
+
ENV['BUNDLE_GEMFILE'] = gemfile
|
218
214
|
end
|
219
215
|
end
|
220
216
|
|
221
|
-
def rails_assets(cmd)
|
217
|
+
def rails_assets(cmd, jets_root:)
|
222
218
|
# rake is available in both rails 4 and 5. rails command only in 5
|
223
219
|
command = "bundle exec rake assets:#{cmd} --trace"
|
224
220
|
command = "RAILS_ENV=#{Jets.env} #{command}" unless Jets.env.development?
|
225
|
-
sh("cd rack && #{command}")
|
221
|
+
sh("cd #{jets_root}rack && #{command}")
|
226
222
|
end
|
227
223
|
|
228
224
|
# Rudimentary rails detection
|
@@ -247,14 +243,14 @@ class Jets::Builders
|
|
247
243
|
# directory untouched and we can also remove a bunch of unnecessary files like
|
248
244
|
# logs before zipping it up.
|
249
245
|
def copy_project
|
250
|
-
headline "Copying current project directory to temporary build area: #{
|
251
|
-
FileUtils.rm_rf(
|
252
|
-
FileUtils.mkdir_p(
|
253
|
-
FileUtils.rm_rf(
|
246
|
+
headline "Copying current project directory to temporary build area: #{"#{stage_area}/code"}"
|
247
|
+
FileUtils.rm_rf("#{build_area}/stage") # clear out from previous build's stage area
|
248
|
+
FileUtils.mkdir_p("#{build_area}/stage")
|
249
|
+
FileUtils.rm_rf("#{stage_area}/code") # remove current code folder
|
254
250
|
move_node_modules(Jets.root, Jets.build_root)
|
255
251
|
begin
|
256
|
-
# puts "cp -r #{@full_project_path} #{
|
257
|
-
FileUtils.cp_r(@full_project_path,
|
252
|
+
# puts "cp -r #{@full_project_path} #{"#{stage_area}/code"}".colorize(:yellow) # uncomment to debug
|
253
|
+
FileUtils.cp_r(@full_project_path, "#{stage_area}/code")
|
258
254
|
ensure
|
259
255
|
move_node_modules(Jets.build_root, Jets.root) # move node_modules directory back
|
260
256
|
end
|
@@ -279,7 +275,7 @@ class Jets::Builders
|
|
279
275
|
return unless Jets.env.development?
|
280
276
|
headline "Reconfiguring webpacker development settings for AWS Lambda."
|
281
277
|
|
282
|
-
webpacker_yml = "#{
|
278
|
+
webpacker_yml = "#{"#{stage_area}/code"}/config/webpacker.yml"
|
283
279
|
return unless File.exist?(webpacker_yml)
|
284
280
|
|
285
281
|
config = YAML.load_file(webpacker_yml)
|
@@ -302,15 +298,23 @@ class Jets::Builders
|
|
302
298
|
return if Jets.poly_only?
|
303
299
|
|
304
300
|
ruby_packager.install
|
305
|
-
reconfigure_rails # call here after
|
301
|
+
reconfigure_rails # call here after "#{stage_area}/code" is available
|
306
302
|
rack_packager.install
|
307
|
-
ruby_packager.finish # by this time we have a /tmp/jets/demo/stage/code/
|
303
|
+
ruby_packager.finish # by this time we have a /tmp/jets/demo/stage/code/vendor/gems
|
308
304
|
rack_packager.finish
|
305
|
+
|
306
|
+
build_lambda_layer
|
307
|
+
end
|
308
|
+
|
309
|
+
def build_lambda_layer
|
310
|
+
return if Jets.poly_only?
|
311
|
+
lambda_layer = LambdaLayer.new
|
312
|
+
lambda_layer.build
|
309
313
|
end
|
310
314
|
|
311
315
|
# TODO: Move logic into plugin instead
|
312
316
|
def reconfigure_rails
|
313
|
-
ReconfigureRails.new("#{
|
317
|
+
ReconfigureRails.new("#{"#{stage_area}/code"}/rack").run
|
314
318
|
end
|
315
319
|
|
316
320
|
def cache_check_message
|
@@ -321,9 +325,9 @@ class Jets::Builders
|
|
321
325
|
|
322
326
|
def check_ruby_version
|
323
327
|
unless ruby_version_supported?
|
324
|
-
puts "You are using
|
328
|
+
puts "You are using Ruby version #{RUBY_VERSION} which is not supported by Jets."
|
325
329
|
ruby_variant = Jets::RUBY_VERSION.split('.')[0..1].join('.') + '.x'
|
326
|
-
abort("Jets uses
|
330
|
+
abort("Jets uses Ruby #{Jets::RUBY_VERSION}. You should use a variant of Ruby #{ruby_variant}".colorize(:red))
|
327
331
|
end
|
328
332
|
end
|
329
333
|
|
@@ -35,11 +35,13 @@ class Jets::Builders
|
|
35
35
|
say "Gem Layer: #{megabytes(opt_size)} - #{stage_area}/opt"
|
36
36
|
say "Total Package: #{megabytes(total_size)}"
|
37
37
|
say "Over limit by: #{megabytes(overlimit)}"
|
38
|
-
|
38
|
+
say "Sometimes blowing away the /tmp/jets cache will reduce the size: rm -rf /tmp/jets"
|
39
|
+
# sh "du -kcsh #{stage_area}/*" unless ENV['TEST'] # uncomment to debug
|
39
40
|
end
|
40
41
|
|
41
42
|
def compute_size(path)
|
42
|
-
|
43
|
+
# -k option is required for macosx but not for linux
|
44
|
+
out = `du -ks #{path}`
|
43
45
|
out.split(' ').first.to_i # bytes
|
44
46
|
end
|
45
47
|
|
@@ -1,8 +1,7 @@
|
|
1
1
|
class Jets::Builders
|
2
2
|
class GemReplacer
|
3
3
|
extend Memoist
|
4
|
-
def initialize(
|
5
|
-
@ruby_version = ruby_version
|
4
|
+
def initialize(options)
|
6
5
|
@options = options
|
7
6
|
end
|
8
7
|
|
@@ -17,25 +16,9 @@ class Jets::Builders
|
|
17
16
|
gem_extractor.run
|
18
17
|
end
|
19
18
|
|
20
|
-
# At this point the current compiled gems have been removed and compiled gems
|
21
|
-
# have been unpacked to code/opt. We can take the unpacked gems in opt and fully
|
22
|
-
# move them into vendor/gems gems now.
|
23
|
-
move_opt_gems_to_vendor
|
24
|
-
|
25
19
|
tidy
|
26
20
|
end
|
27
21
|
|
28
|
-
def move_opt_gems_to_vendor
|
29
|
-
code = "#{Jets.build_root}/stage/code"
|
30
|
-
opt_gems = "#{code}/opt/ruby/gems/#{Jets::Gems.ruby_folder}"
|
31
|
-
vendor_gems = "#{code}/vendor/gems/ruby/#{Jets::Gems.ruby_folder}"
|
32
|
-
# https://stackoverflow.com/questions/23698183/how-to-force-cp-to-overwrite-directory-instead-of-creating-another-one-inside
|
33
|
-
# Trailing slashes are required
|
34
|
-
sh "rsync -a --links #{opt_gems}/ #{vendor_gems}/"
|
35
|
-
# clean up opt compiled gems
|
36
|
-
FileUtils.rm_rf("#{code}/opt/ruby")
|
37
|
-
end
|
38
|
-
|
39
22
|
def sh(command)
|
40
23
|
puts "=> #{command}".colorize(:green)
|
41
24
|
success = system(command)
|
@@ -43,12 +26,16 @@ class Jets::Builders
|
|
43
26
|
success
|
44
27
|
end
|
45
28
|
|
29
|
+
def ruby_folder
|
30
|
+
Jets::Gems.ruby_folder
|
31
|
+
end
|
32
|
+
|
46
33
|
# remove unnecessary files to reduce package size
|
47
34
|
def tidy
|
48
35
|
# project_root: /tmp/jets/demo/stage/code/
|
49
36
|
# /tmp/jets/demo/stage/code/bundled
|
50
|
-
tidy_gems("#{@options[:project_root]}/
|
51
|
-
tidy_gems("#{@options[:project_root]}/
|
37
|
+
tidy_gems("#{@options[:project_root]}/ruby/gems/#{ruby_folder}/*/gems/*")
|
38
|
+
tidy_gems("#{@options[:project_root]}/ruby/gems/#{ruby_folder}/*/bundler/gems/*")
|
52
39
|
end
|
53
40
|
|
54
41
|
def tidy_gems(gems_path)
|
@@ -2,50 +2,68 @@ class Jets::Builders
|
|
2
2
|
class LambdaLayer
|
3
3
|
include Util
|
4
4
|
|
5
|
-
# At this point
|
6
|
-
#
|
7
|
-
#
|
8
|
-
# from stage/code/vendor/gems/ruby/2.5.0
|
9
|
-
# to stage/opt/ruby/gems/2.5.0
|
10
|
-
#
|
11
|
-
# So we can move gems into the Lambda Layer. Important folders later:
|
12
|
-
#
|
13
|
-
# stage/code/opt/lib
|
14
|
-
# stage/code/opt/ruby
|
15
|
-
#
|
5
|
+
# At this point gems are in the stage/code and stage/rack folders still.
|
6
|
+
# We consolidate all gems to stage/opt.
|
7
|
+
# Then replace the binary gems.
|
16
8
|
def build
|
17
|
-
|
18
|
-
|
19
|
-
symlink_vendor_gems
|
9
|
+
consolidate_gems_to_opt
|
10
|
+
replace_compiled_gems
|
20
11
|
end
|
21
12
|
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
13
|
+
# Also restructure the folder from:
|
14
|
+
# vendor/gems/ruby/2.5.0
|
15
|
+
# To:
|
16
|
+
# ruby/gems/2.5.0
|
17
|
+
#
|
18
|
+
# For Lambda Layer structure
|
19
|
+
def consolidate_gems_to_opt
|
20
|
+
src = "#{stage_area}/code/vendor/gems/ruby/2.5.0"
|
21
|
+
dest = "#{stage_area}/opt/ruby/gems/2.5.0"
|
22
|
+
rsync_and_link(src, dest)
|
23
|
+
|
24
|
+
return unless Jets.rack?
|
25
|
+
|
26
|
+
src = "#{stage_area}/rack/vendor/gems/ruby/2.5.0"
|
27
|
+
rsync_and_link(src, dest)
|
27
28
|
end
|
28
29
|
|
29
|
-
def
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
FileUtils.
|
35
|
-
|
36
|
-
#
|
37
|
-
|
38
|
-
FileUtils.
|
39
|
-
FileUtils.rmdir("#{code_area}/vendor") if Dir.empty?("#{code_area}/vendor")
|
30
|
+
def rsync_and_link(src, dest)
|
31
|
+
FileUtils.mkdir_p(dest)
|
32
|
+
# Trailing slashes are required
|
33
|
+
sh "rsync -a --links #{src}/ #{dest}/"
|
34
|
+
|
35
|
+
FileUtils.rm_rf(src) # blow away original 2.5.0 folder
|
36
|
+
|
37
|
+
# Create symlink that will point to the gems in the Lambda Layer:
|
38
|
+
# stage/opt/ruby/gems/2.5.0 -> /opt/ruby/gems/2.5.0
|
39
|
+
FileUtils.ln_sf("/opt/ruby/gems/#{Jets::Gems.ruby_folder}", src)
|
40
40
|
end
|
41
41
|
|
42
|
-
#
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
42
|
+
# replace_compiled_gems:
|
43
|
+
# remove binary gems in vendor/gems/ruby/2.5.0
|
44
|
+
# extract binary gems in opt/ruby/gems/2.5.0
|
45
|
+
# move binary gems from opt/ruby/gems/2.5.0 to vendor/gems/ruby/2.5.0
|
46
|
+
#
|
47
|
+
# After this point, gems have been replace in stage/code/vendor/gems with their
|
48
|
+
# binary extensions: a good state. This method moves these gems to the Lambda
|
49
|
+
# Layers structure and creates a symlinks to it. First:
|
50
|
+
#
|
51
|
+
# from stage/code/vendor/gems/ruby/2.5.0
|
52
|
+
# to stage/opt/ruby/gems/2.5.0
|
53
|
+
#
|
54
|
+
# Then:
|
55
|
+
#
|
56
|
+
# stage/code/vendor/gems/ruby/2.5.0 -> /opt/ruby/gems/2.5.0
|
57
|
+
#
|
58
|
+
def replace_compiled_gems
|
59
|
+
project_root = "#{stage_area}/opt"
|
60
|
+
headline "Replacing compiled gems with AWS Lambda Linux compiled versions: #{project_root}"
|
61
|
+
options = {
|
62
|
+
s3: "lambdagems2",
|
63
|
+
build_root: cache_area, # used in jets-gems
|
64
|
+
project_root: project_root, # used in gem_replacer and jets-gems
|
65
|
+
}
|
66
|
+
GemReplacer.new(options).run
|
49
67
|
end
|
50
68
|
end
|
51
69
|
end
|
@@ -3,9 +3,11 @@ class Jets::Builders
|
|
3
3
|
def finish
|
4
4
|
return unless gemfile_exist?
|
5
5
|
|
6
|
+
super
|
7
|
+
|
6
8
|
symlink_gems
|
7
|
-
rack_symlink
|
8
9
|
copy_rackup_wrappers
|
10
|
+
rack_symlink
|
9
11
|
end
|
10
12
|
|
11
13
|
def symlink_gems
|
@@ -31,10 +33,10 @@ class Jets::Builders
|
|
31
33
|
# Moves folder to a stage folder and create a symlink its place
|
32
34
|
# that links from /var/task to /tmp. Example:
|
33
35
|
#
|
34
|
-
#
|
36
|
+
# stage/code/rack => /tmp/rack
|
35
37
|
#
|
36
38
|
def rack_symlink
|
37
|
-
src =
|
39
|
+
src = @full_app_root
|
38
40
|
return unless File.exist?(src)
|
39
41
|
|
40
42
|
dest = "#{stage_area}/rack"
|
@@ -43,7 +45,7 @@ class Jets::Builders
|
|
43
45
|
FileUtils.mv(src, dest)
|
44
46
|
|
45
47
|
# Create symlink
|
46
|
-
FileUtils.ln_sf("/tmp/rack",
|
48
|
+
FileUtils.ln_sf("/tmp/rack", src)
|
47
49
|
end
|
48
50
|
end
|
49
51
|
end
|