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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 751c93f86f093c6acb059fb618e50c6bf7afdcd643365bba49ea4b62cd3a0d2f
4
- data.tar.gz: c542c41f988f565ef3fa19fa7790dc90961906a92d1d4c631a409febac512151
3
+ metadata.gz: fe68aea730b33f60b486186a386b6d0f30909e370cbb04060ec853c0b831c205
4
+ data.tar.gz: aac8106b0ea1223b8208f28036b54cd19fc9d7e5a1c357513c0c1ad674f1a499
5
5
  SHA512:
6
- metadata.gz: b0c12539cc50ca7241c0b135964e22dda9b76fd96e3a8086c526a5ed7f6d4e54f771dd2d5e417f01063803e7553bf008680d24908988d14e39bef1ef959cc666
7
- data.tar.gz: 5aa8d4a58de8ef1b24f0d5e137ce33846aea48138af7ff10a6cd4e329fafccc567af15dafbfff46ae4db5c8ce1dc2f40d21e108a417d9a7a0fcf1f480ff8c078
6
+ metadata.gz: 8cbf12325ca0fef018c9e3ad776c1264f2455f87f055f1a8cfc664ffbe295cdfe11ab2f8f9904d18a223e5ee48de9a54c8c66d02e52c961c574b46f636ed28b6
7
+ data.tar.gz: 6ae00057569e6a2f139e2869eeccc2fc1bcbda02caebc3d9a17bafbb58f1831f3bb41f777457ed80e9c5fdc4bf4c7d68a334255024c17651b83e65e8d507b6ad
@@ -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
@@ -11,7 +11,7 @@ GIT
11
11
  PATH
12
12
  remote: .
13
13
  specs:
14
- jets (1.3.6)
14
+ jets (1.3.7)
15
15
  actionpack (>= 5.2.1)
16
16
  actionview (>= 5.2.1)
17
17
  activerecord (>= 5.2.1)
@@ -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/bundle gems now.
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/bundle/ruby/#{Jets::Gems.ruby_folder}"
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/bundle, this includes
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/bundle/ruby/2.5.0
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/bundle/ruby/#{ruby_folder}"
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/bundle/ruby")
37
- FileUtils.rmdir("#{code_area}/vendor/bundle")
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/bundle/ruby/2.5.0 -> /opt/ruby/gems/2.5.0
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/bundle/ruby/#{ruby_folder}"
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/bundle/ruby/#{ruby_folder}"
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/bundle/ruby/2.5.0 (done in install phase)
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/bundle/ruby/2.5.0
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/bundle/ruby/2.5.0
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/bundle --without development test"
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/bundle/ruby/2.5.0/bundler/gems/webpacker-a8c46614c675
122
- Dir.glob("#{cache_area}/vendor/bundle/ruby/2.5.0/bundler/gems/*").each do |path|
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/bundle/.bundle/config
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/bundle"
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/bundle"
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/bundle")
186
+ if File.exist?("#{cache_area}/vendor/gems")
187
187
  FileUtils.mkdir_p(File.dirname(vendor_bundle))
188
- FileUtils.cp_r("#{cache_area}/vendor/bundle", vendor_bundle)
188
+ FileUtils.cp_r("#{cache_area}/vendor/gems", vendor_bundle)
189
189
  end
190
190
  end
191
191
 
@@ -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 bundled pack handlers public/assets]
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/bundle folder regardless of the level of the folder
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/bundle/**/*").each do |path|
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/bundle/ruby/#{ruby_minor_version}/cache"
68
+ cache_path = "#{@project_root}/vendor/gems/ruby/#{ruby_minor_version}/cache"
69
69
  FileUtils.rm_rf(cache_path)
70
70
  end
71
71
 
@@ -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', 'job'
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
@@ -1,3 +1,3 @@
1
1
  module Jets
2
- VERSION = "1.3.6"
2
+ VERSION = "1.3.7"
3
3
  end
@@ -126,21 +126,21 @@ EOL
126
126
  #
127
127
  # Example paths:
128
128
  # Macosx:
129
- # vendor/bundle/ruby/2.5.0/extensions/x86_64-darwin-16/2.5.0-static/nokogiri-1.8.1
130
- # vendor/bundle/ruby/2.5.0/extensions/x86_64-darwin-16/2.5.0-static/byebug-9.1.0
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/bundle/ruby/2.5.0/extensions/x86_64-linux/2.5.0-static/nokogiri-1.8.1
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/bundle/ruby/2.5.0/extensions/x86_64-linux/2.5.0/pg-0.21.0
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/bundle/ruby/*/extensions/**/**/*.{so,bundle}")
136
+ Dir.glob("#{Jets.build_root}/cache/vendor/gems/ruby/*/extensions/**/**/*.{so,bundle}")
137
137
  end
138
138
 
139
- # Input: vendor/bundle/ruby/2.5.0/extensions/x86_64-darwin-16/2.5.0-static/byebug-9.1.0
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 = /vendor\/bundle\/ruby\/\d+\.\d+\.\d+\/extensions\/.*?\/.*?\/(.*?)\//
143
- gem_name = path.match(regexp)[1]
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/bundle/ruby/2.5.0/extensions/x86_64-darwin-16/2.5.0-static/byebug-9.1.0
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/bundle} &&
87
+ path =~ %r{vendor/gems} &&
88
88
  File.basename(path) == full_gem_name
89
89
  end
90
90
  gem_dirs.each do |dir|
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jets
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.6
4
+ version: 1.3.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tung Nguyen