jets 1.3.6 → 1.3.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/Gemfile.lock +1 -1
- data/lib/jets/builders/gem_replacer.rb +2 -2
- data/lib/jets/builders/lambda_layer.rb +8 -7
- data/lib/jets/builders/rack_packager.rb +1 -1
- data/lib/jets/builders/ruby_packager.rb +11 -11
- data/lib/jets/builders/tidy.rb +4 -4
- data/lib/jets/commands/new.rb +5 -1
- data/lib/jets/version.rb +1 -1
- data/vendor/jets-gems/lib/jets/gems/check.rb +8 -8
- data/vendor/jets-gems/lib/jets/gems/extract/gem.rb +2 -2
- 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: fe68aea730b33f60b486186a386b6d0f30909e370cbb04060ec853c0b831c205
|
4
|
+
data.tar.gz: aac8106b0ea1223b8208f28036b54cd19fc9d7e5a1c357513c0c1ad674f1a499
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8cbf12325ca0fef018c9e3ad776c1264f2455f87f055f1a8cfc664ffbe295cdfe11ab2f8f9904d18a223e5ee48de9a54c8c66d02e52c961c574b46f636ed28b6
|
7
|
+
data.tar.gz: 6ae00057569e6a2f139e2869eeccc2fc1bcbda02caebc3d9a17bafbb58f1831f3bb41f777457ed80e9c5fdc4bf4c7d68a334255024c17651b83e65e8d507b6ad
|
data/CHANGELOG.md
CHANGED
@@ -3,6 +3,10 @@
|
|
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.3.7]
|
7
|
+
- #100 from tongueroo/vendor-gems bundle in vendor/gems folder to avoid vendor/bundle collison
|
8
|
+
- use database from cli option in api mode for new
|
9
|
+
|
6
10
|
## [1.3.6]
|
7
11
|
- Merge pull request #91 from mveer99/patch-1 jets deploy production docs
|
8
12
|
- #96 from tongueroo/mega-mode-prod-deploy fix mega mode prod deploy, fix typo
|
data/Gemfile.lock
CHANGED
@@ -19,7 +19,7 @@ class Jets::Builders
|
|
19
19
|
|
20
20
|
# At this point the current compiled gems have been removed and compiled gems
|
21
21
|
# have been unpacked to code/opt. We can take the unpacked gems in opt and fully
|
22
|
-
# move them into vendor/
|
22
|
+
# move them into vendor/gems gems now.
|
23
23
|
move_opt_gems_to_vendor
|
24
24
|
|
25
25
|
tidy
|
@@ -28,7 +28,7 @@ class Jets::Builders
|
|
28
28
|
def move_opt_gems_to_vendor
|
29
29
|
code = "#{Jets.build_root}/stage/code"
|
30
30
|
opt_gems = "#{code}/opt/ruby/gems/#{Jets::Gems.ruby_folder}"
|
31
|
-
vendor_gems = "#{code}/vendor/
|
31
|
+
vendor_gems = "#{code}/vendor/gems/ruby/#{Jets::Gems.ruby_folder}"
|
32
32
|
# https://stackoverflow.com/questions/23698183/how-to-force-cp-to-overwrite-directory-instead-of-creating-another-one-inside
|
33
33
|
# Trailing slashes are required
|
34
34
|
sh "rsync -a --links #{opt_gems}/ #{vendor_gems}/"
|
@@ -2,10 +2,10 @@ class Jets::Builders
|
|
2
2
|
class LambdaLayer
|
3
3
|
include Util
|
4
4
|
|
5
|
-
# At this point we gems have all been moved to stage/code/vendor/
|
5
|
+
# At this point we gems have all been moved to stage/code/vendor/gems, this includes
|
6
6
|
# binary gems, a good state. This method moves them:
|
7
7
|
#
|
8
|
-
# from stage/code/vendor/
|
8
|
+
# from stage/code/vendor/gems/ruby/2.5.0
|
9
9
|
# to stage/opt/ruby/gems/2.5.0
|
10
10
|
#
|
11
11
|
# So we can move gems into the Lambda Layer. Important folders later:
|
@@ -28,20 +28,21 @@ class Jets::Builders
|
|
28
28
|
|
29
29
|
def move_vendor_to_opt
|
30
30
|
ruby_folder = Jets::Gems.ruby_folder
|
31
|
-
gems_original = "#{code_area}/vendor/
|
31
|
+
gems_original = "#{code_area}/vendor/gems/ruby/#{ruby_folder}"
|
32
32
|
gems = "#{stage_area}/opt/ruby/gems/#{ruby_folder}"
|
33
|
+
|
33
34
|
FileUtils.mkdir_p(File.dirname(gems))
|
34
35
|
FileUtils.mv(gems_original, gems)
|
35
36
|
# Deleting in this way to make sure folders are empty before we delete them
|
36
|
-
FileUtils.rmdir("#{code_area}/vendor/
|
37
|
-
FileUtils.rmdir("#{code_area}/vendor/
|
37
|
+
FileUtils.rmdir("#{code_area}/vendor/gems/ruby")
|
38
|
+
FileUtils.rmdir("#{code_area}/vendor/gems")
|
38
39
|
FileUtils.rmdir("#{code_area}/vendor") if Dir.empty?("#{code_area}/vendor")
|
39
40
|
end
|
40
41
|
|
41
|
-
# Simple logic: vendor/
|
42
|
+
# Simple logic: vendor/gems/ruby/2.5.0 -> /opt/ruby/gems/2.5.0
|
42
43
|
def symlink_vendor_gems
|
43
44
|
ruby_folder = Jets::Gems.ruby_folder
|
44
|
-
dest = "#{code_area}/vendor/
|
45
|
+
dest = "#{code_area}/vendor/gems/ruby/#{ruby_folder}"
|
45
46
|
FileUtils.mkdir_p(File.dirname(dest))
|
46
47
|
# puts "ln -sf /opt/ruby/gems/#{ruby_folder} #{dest}" # uncomment to debug
|
47
48
|
FileUtils.ln_sf("/opt/ruby/gems/#{ruby_folder}", dest)
|
@@ -11,7 +11,7 @@ class Jets::Builders
|
|
11
11
|
def symlink_gems
|
12
12
|
ruby_folder = Jets::Gems.ruby_folder
|
13
13
|
# IE: @full_app_root: /tmp/jets/demo/stage/code/rack
|
14
|
-
dest = "#{@full_app_root}/vendor/
|
14
|
+
dest = "#{@full_app_root}/vendor/gems/ruby/#{ruby_folder}"
|
15
15
|
FileUtils.mkdir_p(File.dirname(dest))
|
16
16
|
FileUtils.ln_sf("/opt/ruby/gems/#{ruby_folder}", dest)
|
17
17
|
end
|
@@ -18,11 +18,11 @@ class Jets::Builders
|
|
18
18
|
setup_bundle_config
|
19
19
|
end
|
20
20
|
|
21
|
-
# build gems in vendor/
|
21
|
+
# build gems in vendor/gems/ruby/2.5.0 (done in install phase)
|
22
22
|
# replace_compiled_gems:
|
23
|
-
# remove binary gems in vendor/
|
23
|
+
# remove binary gems in vendor/gems/ruby/2.5.0
|
24
24
|
# extract binary gems in opt/ruby/gems/2.5.0
|
25
|
-
# move binary gems from opt/ruby/gems/2.5.0 to vendor/
|
25
|
+
# move binary gems from opt/ruby/gems/2.5.0 to vendor/gems/ruby/2.5.0
|
26
26
|
def finish
|
27
27
|
return unless gemfile_exist?
|
28
28
|
|
@@ -57,7 +57,7 @@ class Jets::Builders
|
|
57
57
|
Bundler.with_clean_env do
|
58
58
|
sh(
|
59
59
|
"cd #{cache_area} && " \
|
60
|
-
"env BUNDLE_IGNORE_CONFIG=1 bundle install --path #{cache_area}/vendor/
|
60
|
+
"env BUNDLE_IGNORE_CONFIG=1 bundle install --path #{cache_area}/vendor/gems --without development test"
|
61
61
|
)
|
62
62
|
end
|
63
63
|
|
@@ -118,8 +118,8 @@ class Jets::Builders
|
|
118
118
|
md[1] # git_sha
|
119
119
|
end
|
120
120
|
|
121
|
-
# IE: /tmp/jets/demo/cache/vendor/
|
122
|
-
Dir.glob("#{cache_area}/vendor/
|
121
|
+
# IE: /tmp/jets/demo/cache/vendor/gems/ruby/2.5.0/bundler/gems/webpacker-a8c46614c675
|
122
|
+
Dir.glob("#{cache_area}/vendor/gems/ruby/2.5.0/bundler/gems/*").each do |path|
|
123
123
|
sha = path.split('-').last[0..6] # only first 7 chars of the git sha
|
124
124
|
unless git_shas.include?(sha)
|
125
125
|
# puts "Removing old submoduled gem: #{path}" # uncomment to see and debug
|
@@ -140,7 +140,7 @@ class Jets::Builders
|
|
140
140
|
# Override project's .bundle/config and ensure that .bundle/config matches
|
141
141
|
# at these 2 spots:
|
142
142
|
# app_root/.bundle/config
|
143
|
-
# vendor/
|
143
|
+
# vendor/gems/.bundle/config
|
144
144
|
cache_bundle_config = "#{cache_area}/.bundle/config"
|
145
145
|
app_bundle_config = "#{@full_app_root}/.bundle/config"
|
146
146
|
FileUtils.mkdir_p(File.dirname(app_bundle_config))
|
@@ -155,7 +155,7 @@ class Jets::Builders
|
|
155
155
|
text =<<-EOL
|
156
156
|
---
|
157
157
|
BUNDLE_FROZEN: "true"
|
158
|
-
BUNDLE_PATH: "vendor/
|
158
|
+
BUNDLE_PATH: "vendor/gems"
|
159
159
|
BUNDLE_WITHOUT: "development:test"
|
160
160
|
EOL
|
161
161
|
bundle_config = "#{cache_area}/.bundle/config"
|
@@ -177,15 +177,15 @@ EOL
|
|
177
177
|
end
|
178
178
|
|
179
179
|
def copy_cache_gems
|
180
|
-
vendor_bundle = "#{@full_app_root}/vendor/
|
180
|
+
vendor_bundle = "#{@full_app_root}/vendor/gems"
|
181
181
|
if File.exist?(vendor_bundle)
|
182
182
|
puts "Removing current vendor_bundle from project"
|
183
183
|
FileUtils.rm_rf(vendor_bundle)
|
184
184
|
end
|
185
185
|
# Leave #{Jets.build_root}/vendor_bundle behind to act as cache
|
186
|
-
if File.exist?("#{cache_area}/vendor/
|
186
|
+
if File.exist?("#{cache_area}/vendor/gems")
|
187
187
|
FileUtils.mkdir_p(File.dirname(vendor_bundle))
|
188
|
-
FileUtils.cp_r("#{cache_area}/vendor/
|
188
|
+
FileUtils.cp_r("#{cache_area}/vendor/gems", vendor_bundle)
|
189
189
|
end
|
190
190
|
end
|
191
191
|
|
data/lib/jets/builders/tidy.rb
CHANGED
@@ -39,7 +39,7 @@ class Jets::Builders
|
|
39
39
|
# We clean out ignored files pretty aggressively. So provide
|
40
40
|
# a way for users to keep files from being cleaned out.
|
41
41
|
def jetskeep
|
42
|
-
defaults = %w[.bundle
|
42
|
+
defaults = %w[.bundle pack handlers public/assets]
|
43
43
|
path = "#{@project_root}/.jetskeep"
|
44
44
|
return defaults unless File.exist?(path)
|
45
45
|
|
@@ -48,9 +48,9 @@ class Jets::Builders
|
|
48
48
|
(defaults + keep).uniq
|
49
49
|
end
|
50
50
|
|
51
|
-
# folders to remove in the vendor/
|
51
|
+
# folders to remove in the vendor/gems folder regardless of the level of the folder
|
52
52
|
def tidy_bundled
|
53
|
-
Dir.glob("#{@project_root}/vendor/
|
53
|
+
Dir.glob("#{@project_root}/vendor/gems/**/*").each do |path|
|
54
54
|
next unless File.directory?(path)
|
55
55
|
dir = File.basename(path)
|
56
56
|
next unless always_removals.include?(dir)
|
@@ -65,7 +65,7 @@ class Jets::Builders
|
|
65
65
|
# actual cache folders that they used.
|
66
66
|
def remove_gem_cache
|
67
67
|
ruby_minor_version = Jets::RUBY_VERSION.split('.')[0..1].join('.') + '.0'
|
68
|
-
cache_path = "#{@project_root}/vendor/
|
68
|
+
cache_path = "#{@project_root}/vendor/gems/ruby/#{ruby_minor_version}/cache"
|
69
69
|
FileUtils.rm_rf(cache_path)
|
70
70
|
end
|
71
71
|
|
data/lib/jets/commands/new.rb
CHANGED
@@ -32,7 +32,11 @@ module Jets::Commands
|
|
32
32
|
@bootstrap = options[:bootstrap]
|
33
33
|
@database = options[:database]
|
34
34
|
@webpacker = options[:webpacker]
|
35
|
-
when 'api'
|
35
|
+
when 'api'
|
36
|
+
@bootstrap = false
|
37
|
+
@database = options[:database]
|
38
|
+
@webpacker = false
|
39
|
+
when 'job'
|
36
40
|
@bootstrap = false
|
37
41
|
@database = false
|
38
42
|
@webpacker = false
|
data/lib/jets/version.rb
CHANGED
@@ -126,21 +126,21 @@ EOL
|
|
126
126
|
#
|
127
127
|
# Example paths:
|
128
128
|
# Macosx:
|
129
|
-
# vendor/
|
130
|
-
# vendor/
|
129
|
+
# vendor/gems/ruby/2.5.0/extensions/x86_64-darwin-16/2.5.0-static/nokogiri-1.8.1
|
130
|
+
# vendor/gems/ruby/2.5.0/extensions/x86_64-darwin-16/2.5.0-static/byebug-9.1.0
|
131
131
|
# Official AWS Lambda Linux AMI:
|
132
|
-
# vendor/
|
132
|
+
# vendor/gems/ruby/2.5.0/extensions/x86_64-linux/2.5.0-static/nokogiri-1.8.1
|
133
133
|
# Circleci Ubuntu based Linux:
|
134
|
-
# vendor/
|
134
|
+
# vendor/gems/ruby/2.5.0/extensions/x86_64-linux/2.5.0/pg-0.21.0
|
135
135
|
def compiled_gem_paths
|
136
|
-
Dir.glob("#{Jets.build_root}/cache/vendor/
|
136
|
+
Dir.glob("#{Jets.build_root}/cache/vendor/gems/ruby/*/extensions/**/**/*.{so,bundle}")
|
137
137
|
end
|
138
138
|
|
139
|
-
# Input: vendor/
|
139
|
+
# Input: vendor/gems/ruby/2.5.0/extensions/x86_64-darwin-16/2.5.0-static/byebug-9.1.0
|
140
140
|
# Output: byebug-9.1.0
|
141
141
|
def gem_name_from_path(path)
|
142
|
-
regexp = /
|
143
|
-
|
142
|
+
regexp = %r{vendor/gems/ruby/\d+\.\d+\.\d+/extensions/.*?/.*?/(.*?)/}
|
143
|
+
path.match(regexp)[1] # gem_name
|
144
144
|
end
|
145
145
|
|
146
146
|
# So can also check for compiled gems with Gem::Specification
|
@@ -52,7 +52,7 @@ module Jets::Gems::Extract
|
|
52
52
|
# The folder contains the re-produced directory structure. Example with
|
53
53
|
# the gem: byebug-9.1.0
|
54
54
|
#
|
55
|
-
# vendor/
|
55
|
+
# vendor/gems/ruby/2.5.0/extensions/x86_64-darwin-16/2.5.0-static/byebug-9.1.0
|
56
56
|
#
|
57
57
|
def download_gem
|
58
58
|
# download - also move to /tmp/jets/demo/compiled_gems folder
|
@@ -84,7 +84,7 @@ module Jets::Gems::Extract
|
|
84
84
|
say "Removing current #{full_gem_name} gem installation:"
|
85
85
|
gem_dirs = Dir.glob("#{project_root}/**/*").select do |path|
|
86
86
|
File.directory?(path) &&
|
87
|
-
path =~ %r{vendor/
|
87
|
+
path =~ %r{vendor/gems} &&
|
88
88
|
File.basename(path) == full_gem_name
|
89
89
|
end
|
90
90
|
gem_dirs.each do |dir|
|