appbundle-updater 1.0.36 → 19.0.4.rc.1

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: '0171110448530a18147369da16dce8eb93e307f41612ec64ff6b6bb9afeaacb2'
4
- data.tar.gz: 51007a24f2ddc9acf07ada87d8bc1569957793a379a873bd86c8b4b8e5834c18
3
+ metadata.gz: 610edf01709d93520dbd4e4bc64fd796b23c045f53961fb02a07778729406d23
4
+ data.tar.gz: 24b6a2a9f05f4b30a5f1f42e5a400e278ca37b8977d3ddf70df22f0f6b9145ae
5
5
  SHA512:
6
- metadata.gz: c2988440b0f9b6f59749ed7fc26e2064945a23de755496d200bbb091915d846f2281c68e168022deec0a2aea129f1756b84c31af626f5a481e24eee25edd15a0
7
- data.tar.gz: 27c221bf29327bbab60560bf79be31eddce5b7717a19d1fdaece80c62741eed1e974fbd8e49d55e94eb0ccb1b00ae82641c2729f81ed7d0b53ff0e97ae6d550c
6
+ metadata.gz: 727dcd147949ee9e311fed28e69dbaa489c96bace756ab3ac9c4bc36d20cb61fac60959dfc35afbf7f23b0e389b789c65efd793a8d9b301546d4764b134cd090
7
+ data.tar.gz: ebf89ef3ce334717e770ae559779e93b3cac4d0373e84d1f33396df2587881bdfa784b29c7923ac1e8a0683292aef12769b061ef005545c5f0ffa97ad29192d9
data/CHANGELOG.md CHANGED
@@ -1,32 +1,50 @@
1
1
  # appbundle-updater Change Log
2
2
 
3
- <!-- latest_release 1.0.36 -->
4
- ## [v1.0.36](https://github.com/chef/appbundle-updater/tree/v1.0.36) (2022-02-09)
3
+ <!-- latest_release 19.0.4 -->
4
+ ## [v19.0.4](https://github.com/chef/appbundle-updater/tree/v19.0.4) (2025-06-17)
5
5
 
6
6
  #### Merged Pull Requests
7
- - Use rake install:local [#100](https://github.com/chef/appbundle-updater/pull/100) ([lamont-granquist](https://github.com/lamont-granquist))
7
+ - Use bundler binary from ruby package instead of from vendor/gems as it&#39;s no longer there [#120](https://github.com/chef/appbundle-updater/pull/120) ([neha-p6](https://github.com/neha-p6))
8
8
  <!-- latest_release -->
9
9
 
10
- <!-- release_rollup since=1.0.23 -->
10
+ <!-- release_rollup since=19.0.2.rc.1 -->
11
11
  ### Changes not yet released to rubygems.org
12
12
 
13
13
  #### Merged Pull Requests
14
- - Use rake install:local [#100](https://github.com/chef/appbundle-updater/pull/100) ([lamont-granquist](https://github.com/lamont-granquist)) <!-- 1.0.36 -->
15
- - Update chefstyle requirement from 2.1.3 to 2.2.0 [#98](https://github.com/chef/appbundle-updater/pull/98) ([dependabot[bot]](https://github.com/dependabot[bot])) <!-- 1.0.35 -->
16
- - Need a version bump for release [#97](https://github.com/chef/appbundle-updater/pull/97) ([lamont-granquist](https://github.com/lamont-granquist)) <!-- 1.0.34 -->
17
- - remove bundle exec from rake install [#96](https://github.com/chef/appbundle-updater/pull/96) ([lamont-granquist](https://github.com/lamont-granquist)) <!-- 1.0.33 -->
18
- - Update chefstyle requirement from 2.1.1 to 2.1.3 [#95](https://github.com/chef/appbundle-updater/pull/95) ([dependabot[bot]](https://github.com/dependabot[bot])) <!-- 1.0.32 -->
19
- - Update chefstyle requirement from 2.1.0 to 2.1.1 [#93](https://github.com/chef/appbundle-updater/pull/93) ([dependabot[bot]](https://github.com/dependabot[bot])) <!-- 1.0.31 -->
20
- - Update chefstyle requirement from 2.0.9 to 2.1.0 [#92](https://github.com/chef/appbundle-updater/pull/92) ([dependabot[bot]](https://github.com/dependabot[bot])) <!-- 1.0.30 -->
21
- - Update chefstyle requirement from 2.0.7 to 2.0.9 [#90](https://github.com/chef/appbundle-updater/pull/90) ([dependabot[bot]](https://github.com/dependabot[bot])) <!-- 1.0.29 -->
22
- - Update chefstyle requirement from 2.0.5 to 2.0.7 [#87](https://github.com/chef/appbundle-updater/pull/87) ([dependabot[bot]](https://github.com/dependabot[bot])) <!-- 1.0.28 -->
23
- - Update chefstyle requirement from 1.7.5 to 2.0.5 [#85](https://github.com/chef/appbundle-updater/pull/85) ([dependabot[bot]](https://github.com/dependabot[bot])) <!-- 1.0.27 -->
24
- - Update parallel requirement from &lt; 1.20 to &lt; 1.21 [#81](https://github.com/chef/appbundle-updater/pull/81) ([dependabot[bot]](https://github.com/dependabot[bot])) <!-- 1.0.26 -->
25
- - Upgrade to GitHub-native Dependabot [#80](https://github.com/chef/appbundle-updater/pull/80) ([dependabot-preview[bot]](https://github.com/dependabot-preview[bot])) <!-- 1.0.25 -->
26
- - Update chefstyle requirement from 1.7.2 to 1.7.5 [#79](https://github.com/chef/appbundle-updater/pull/79) ([dependabot-preview[bot]](https://github.com/dependabot-preview[bot])) <!-- 1.0.24 -->
14
+ - Use bundler binary from ruby package instead of from vendor/gems as it&#39;s no longer there [#120](https://github.com/chef/appbundle-updater/pull/120) ([neha-p6](https://github.com/neha-p6)) <!-- 19.0.4 -->
15
+ - Skip inspec-core-bin for 19 [#117](https://github.com/chef/appbundle-updater/pull/117) ([tpowell-progress](https://github.com/tpowell-progress)) <!-- 19.0.3 -->
16
+ - Delimit rc and version no as rc.1 in gemspec as using &#39;rc1&#39; has not pushed the gem to artifactory [#116](https://github.com/chef/appbundle-updater/pull/116) ([neha-p6](https://github.com/neha-p6)) <!-- 19.0.2 -->
27
17
  <!-- release_rollup -->
28
18
 
29
19
  <!-- latest_stable_release -->
20
+ ## [v19.0.2.rc.1](https://github.com/chef/appbundle-updater/tree/v19.0.2.rc.1) (2025-02-11)
21
+
22
+ #### Merged Pull Requests
23
+ - update codeowners to include omnibus team &amp; some cleanup [#103](https://github.com/chef/appbundle-updater/pull/103) ([vkarve-chef](https://github.com/vkarve-chef))
24
+ - update ruby images to 3.0 and 3.1 [#108](https://github.com/chef/appbundle-updater/pull/108) ([rishichawda](https://github.com/rishichawda))
25
+ - add release branches [#110](https://github.com/chef/appbundle-updater/pull/110) ([rishichawda](https://github.com/rishichawda))
26
+ - use habitat build instead of omnibus [#107](https://github.com/chef/appbundle-updater/pull/107) ([rishichawda](https://github.com/rishichawda))
27
+ - Add rc tag to the gem from gemspec instead of from VERSION file [#113](https://github.com/chef/appbundle-updater/pull/113) ([neha-p6](https://github.com/neha-p6))
28
+ - Add rc tag to the gem from gemspec instead of from VERSION file [#115](https://github.com/chef/appbundle-updater/pull/115) ([neha-p6](https://github.com/neha-p6))
29
+ <!-- latest_stable_release -->
30
+
31
+ ## [v1.0.36](https://github.com/chef/appbundle-updater/tree/v1.0.36) (2022-02-09)
32
+
33
+ #### Merged Pull Requests
34
+ - Update chefstyle requirement from 1.7.2 to 1.7.5 [#79](https://github.com/chef/appbundle-updater/pull/79) ([dependabot-preview[bot]](https://github.com/dependabot-preview[bot]))
35
+ - Upgrade to GitHub-native Dependabot [#80](https://github.com/chef/appbundle-updater/pull/80) ([dependabot-preview[bot]](https://github.com/dependabot-preview[bot]))
36
+ - Update parallel requirement from &lt; 1.20 to &lt; 1.21 [#81](https://github.com/chef/appbundle-updater/pull/81) ([dependabot[bot]](https://github.com/dependabot[bot]))
37
+ - Update chefstyle requirement from 1.7.5 to 2.0.5 [#85](https://github.com/chef/appbundle-updater/pull/85) ([dependabot[bot]](https://github.com/dependabot[bot]))
38
+ - Update chefstyle requirement from 2.0.5 to 2.0.7 [#87](https://github.com/chef/appbundle-updater/pull/87) ([dependabot[bot]](https://github.com/dependabot[bot]))
39
+ - Update chefstyle requirement from 2.0.7 to 2.0.9 [#90](https://github.com/chef/appbundle-updater/pull/90) ([dependabot[bot]](https://github.com/dependabot[bot]))
40
+ - Update chefstyle requirement from 2.0.9 to 2.1.0 [#92](https://github.com/chef/appbundle-updater/pull/92) ([dependabot[bot]](https://github.com/dependabot[bot]))
41
+ - Update chefstyle requirement from 2.1.0 to 2.1.1 [#93](https://github.com/chef/appbundle-updater/pull/93) ([dependabot[bot]](https://github.com/dependabot[bot]))
42
+ - Update chefstyle requirement from 2.1.1 to 2.1.3 [#95](https://github.com/chef/appbundle-updater/pull/95) ([dependabot[bot]](https://github.com/dependabot[bot]))
43
+ - remove bundle exec from rake install [#96](https://github.com/chef/appbundle-updater/pull/96) ([lamont-granquist](https://github.com/lamont-granquist))
44
+ - Need a version bump for release [#97](https://github.com/chef/appbundle-updater/pull/97) ([lamont-granquist](https://github.com/lamont-granquist))
45
+ - Update chefstyle requirement from 2.1.3 to 2.2.0 [#98](https://github.com/chef/appbundle-updater/pull/98) ([dependabot[bot]](https://github.com/dependabot[bot]))
46
+ - Use rake install:local [#100](https://github.com/chef/appbundle-updater/pull/100) ([lamont-granquist](https://github.com/lamont-granquist))
47
+
30
48
  ## [v1.0.23](https://github.com/chef/appbundle-updater/tree/v1.0.23) (2021-03-16)
31
49
 
32
50
  #### Merged Pull Requests
@@ -45,7 +63,6 @@
45
63
  - Update chefstyle requirement from 1.6.2 to 1.7.1 [#74](https://github.com/chef/appbundle-updater/pull/74) ([dependabot-preview[bot]](https://github.com/dependabot-preview[bot]))
46
64
  - Update chefstyle requirement from 1.7.1 to 1.7.2 [#75](https://github.com/chef/appbundle-updater/pull/75) ([dependabot-preview[bot]](https://github.com/dependabot-preview[bot]))
47
65
  - Add support for post bundle install hook [#76](https://github.com/chef/appbundle-updater/pull/76) ([lamont-granquist](https://github.com/lamont-granquist))
48
- <!-- latest_stable_release -->
49
66
 
50
67
  ## [v1.0.8](https://github.com/chef/appbundle-updater/tree/v1.0.8) (2020-08-12)
51
68
 
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.0.36
1
+ 19.0.4
@@ -4,7 +4,7 @@ require "appbundle_updater/version"
4
4
 
5
5
  Gem::Specification.new do |spec|
6
6
  spec.name = "appbundle-updater"
7
- spec.version = AppbundleUpdater::VERSION
7
+ spec.version = "#{AppbundleUpdater::VERSION}.rc.1"
8
8
  spec.authors = ["lamont-granquist"]
9
9
  spec.email = ["lamont@chef.io"]
10
10
  spec.description = %q{Updates appbundled apps in Chef's omnibus packages}
@@ -24,22 +24,43 @@ require "rubygems/package"
24
24
  require "zlib"
25
25
  require "tempfile"
26
26
 
27
- # FIXME: move to helpers mixin
28
-
29
27
  def windows?
30
28
  @windows ||= RUBY_PLATFORM =~ /mswin|mingw|windows/
31
29
  end
32
30
 
33
- def chefdk
31
+ def habitat
34
32
  if windows?
35
- Pathname.new(File.join(ENV["SYSTEMDRIVE"], "opscode", ARGV[0]))
33
+ Pathname.new(File.join(ENV["SYSTEMDRIVE"], "hab", "pkgs"))
36
34
  else
37
- Pathname.new(File.join("/opt", ARGV[0]))
35
+ Pathname.new(File.join("/hab", "pkgs"))
38
36
  end
39
37
  end
40
38
 
39
+ # find the path to installed package in habitat package directory
40
+ # example, /hab/pkgs/{ARGV[0]}/{ARGV[1]}/x.x.x/xxxxxxxxxxxxxx
41
+ def pkg_path
42
+ pkg_path = habitat.join(ARGV[0], ARGV[1])
43
+ version = Dir.glob("#{pkg_path}/*").max
44
+ raise "No existing installation found for #{ARGV[0]}/#{ARGV[1]} in #{pkg_path}" if version.nil?
45
+
46
+ pkg_path = pkg_path.join(version)
47
+ build_no = Dir.glob("#{pkg_path}/*").max
48
+ raise "No existing installation found for #{ARGV[0]}/#{ARGV[1]}/#{version} in #{pkg_path}" if build_no.nil?
49
+
50
+ pkg_path.join(build_no)
51
+ end
52
+
53
+ def vendor_bin_dir
54
+ pkg_path.join("vendor", "bin")
55
+ end
56
+
41
57
  def bin_dir
42
- chefdk.join("embedded/bin")
58
+ pkg_path.join("bin")
59
+ end
60
+
61
+ def ruby_pkg
62
+ # NOTE: this is sort of a 'hacky' way maybe to find which ruby binary to use?
63
+ File.read("#{pkg_path}/DEPS").split("\n").find { |l| l.start_with?(%r{(core|chef)\/ruby}) }
43
64
  end
44
65
 
45
66
  ENV["PATH"] = ( [ bin_dir ] + ENV["PATH"].split(File::PATH_SEPARATOR) ).join(File::PATH_SEPARATOR)
@@ -50,7 +71,7 @@ ENV_KEYS = %w{
50
71
 
51
72
  def run(cmd)
52
73
  ENV_KEYS.each { |key| ENV["_YOLO_#{key}"] = ENV[key]; ENV.delete(key) }
53
- ENV["PATH"] = bin_dir.to_s + File::PATH_SEPARATOR + ENV["_YOLO_PATH"]
74
+ ENV["PATH"] = habitat.join(ruby_pkg, "bin").to_s + File::PATH_SEPARATOR + ENV["_YOLO_PATH"]
54
75
  puts " running: #{cmd}"
55
76
  output = `#{cmd} 2>&1` # FIXME: bash/zsh-ism, will not work on csh
56
77
  unless $?.exited? && $?.exitstatus == 0
@@ -66,7 +87,7 @@ TAR_LONGLINK = "././@LongLink".freeze
66
87
 
67
88
  def install_package_dependencies
68
89
  banner("Installing Packages")
69
- case `#{bin_dir}/ohai platform_family` # rubocop: disable Lint/LiteralAsCondition
90
+ case `hab pkg exec #{ARGV[0]}/#{ARGV[1]} ohai platform_family` # rubocop: disable Lint/LiteralAsCondition
70
91
  when /debian/
71
92
  ENV["DEBIAN_FRONTEND"] = "noninteractive"
72
93
  run("apt-get -y update")
@@ -118,7 +139,7 @@ def extract_tgz(file, destination = ".")
118
139
  end
119
140
  end
120
141
 
121
- App = Struct.new(:name, :repo, :bundle_without, :install_commands, :gems) do
142
+ App = Struct.new(:name, :origin, :bundle_without, :install_commands, :gems) do
122
143
  def initialize(*)
123
144
  super
124
145
  self.gems ||= {}
@@ -129,88 +150,66 @@ App = Struct.new(:name, :repo, :bundle_without, :install_commands, :gems) do
129
150
  end
130
151
  end
131
152
 
132
- chef_install_command = "#{bin_dir.join("rake")} install:local"
153
+ chef_install_command = "#{vendor_bin_dir.join("rake")} install:local"
133
154
 
134
- CHEFDK_APPS = [
155
+ HABITAT_PACKAGES = [
135
156
  App.new(
136
157
  "berkshelf",
137
- "berkshelf/berkshelf",
158
+ "chef",
138
159
  "docs changelog",
139
- "#{bin_dir.join("rake")} install"
160
+ "#{vendor_bin_dir.join("rake")} install"
140
161
  ),
141
162
  App.new(
163
+ "chef-infra-client",
142
164
  "chef",
143
- "chef/chef",
144
165
  "server docgen maintenance pry integration ci chefstyle profile",
145
166
  chef_install_command,
146
167
  {
147
168
  "chef" => %w{docgen chefstyle},
148
169
  "chef-bin" => %w{development},
149
170
  "ohai" => %w{development docs debug profile},
150
- "inspec-core-bin" => %w{development},
151
- }
152
- ),
153
- App.new(
154
- "chef-dk",
155
- "chef/chef-dk",
156
- "development test",
157
- "#{bin_dir.join("bundle")} install",
158
- {
159
- "chef" => %w{docgen chefstyle omnibus_package},
160
- "foodcritic" => %w{development test},
161
- "test-kitchen" => %w{changelog debug docs development},
162
- "inspec" => %w{deploy tools maintenance integration},
163
- "chef-run" => %w{changelog docs debug},
164
- "chef-cli" => %w{changelog docs debug},
165
- "berkshelf" => %w{changelog docs debug development},
166
- "chef-bin" => %w{changelog},
167
- "chef-apply" => %w{changelog},
168
- "chef-vault" => %w{changelog},
169
- "ohai" => %w{changelog},
170
- "opscode-pushy-client" => %w{changelog},
171
- "cookstyle" => %w{changelog},
171
+ # "inspec-core-bin" => %w{development}, # <== temporary? for RC version
172
172
  }
173
173
  ),
174
174
  App.new(
175
175
  "chef-vault",
176
- "chef/chef-vault",
176
+ "chef",
177
177
  "development",
178
- "#{bin_dir.join("rake")} install"
178
+ "#{vendor_bin_dir.join("rake")} install"
179
179
  ),
180
180
  App.new(
181
181
  "cookstyle",
182
- "chef/cookstyle",
182
+ "chef",
183
183
  "development debug docs",
184
- "#{bin_dir.join("rake")} install"
185
- ),
186
- App.new(
187
- "foodcritic",
188
- "foodcritic/foodcritic",
189
- "development",
190
- "#{bin_dir.join("rake")} install"
184
+ "#{vendor_bin_dir.join("rake")} install"
191
185
  ),
192
186
  App.new(
193
187
  "inspec",
194
- "chef/inspec",
188
+ "chef",
195
189
  "test integration tools maintenance deploy",
196
- "#{bin_dir.join("rake")} install"
190
+ "#{vendor_bin_dir.join("rake")} install"
197
191
  ),
198
192
  App.new(
199
193
  "ohai",
200
- "chef/ohai",
194
+ "chef",
201
195
  "development docs debug",
202
- "#{bin_dir.join("rake")} install"
196
+ "#{vendor_bin_dir.join("rake")} install"
203
197
  ),
204
198
  App.new(
205
199
  "test-kitchen",
206
- "test-kitchen/test-kitchen",
200
+ "chef",
207
201
  "changelog integration debug chefstyle docs",
208
- "#{bin_dir.join("rake")} install"
202
+ "#{vendor_bin_dir.join("rake")} install"
209
203
  ),
210
204
  ].freeze
211
205
 
206
+ def bundler_from_ruby_pkg
207
+ ruby_path = `hab pkg path #{ruby_pkg}`.strip
208
+ File.join(ruby_path, "bin", "bundle")
209
+ end
210
+
212
211
  class Updater
213
- attr_reader :app, :ref, :tarball, :repo, :gems, :install_commands
212
+ attr_reader :app, :ref, :tarball, :origin, :repo, :gems, :install_commands
214
213
 
215
214
  def initialize(options)
216
215
  @app = options[:app]
@@ -219,6 +218,7 @@ class Updater
219
218
  @extra_bin_files = options[:extra_bin_files]
220
219
  @binstubs_source = options[:binstubs_source]
221
220
  @repo = options[:repo] || @app.repo
221
+ @origin = options[:origin] || @app.origin
222
222
  @gems = @app.gems
223
223
  @install_commands = @app.install_commands
224
224
  end
@@ -228,101 +228,103 @@ class Updater
228
228
  abort "#{$0} needs to be run as root user or with sudo"
229
229
  end
230
230
 
231
- banner("Cleaning #{app} checkout")
232
- app_dir.rmtree if app_dir.directory?
233
-
234
- top_dir = chefdk.join("embedded/apps")
235
- unless File.exist?(top_dir)
236
- banner("Creating #{top_dir} directory")
237
- FileUtils.mkdir_p top_dir
238
- end
239
-
240
231
  install_package_dependencies
241
232
 
242
- if tarball
243
- # NOTE: THIS IS DELIBERATELY PURE RUBY USING NO NATIVE GEMS AND ONLY
244
- # THE RUBY STDLIB BY DESIGN
245
- git_url = "https://github.com/#{repo}/archive/#{ref}.tar.gz"
246
- banner("Extracting #{app} from #{git_url}")
247
- Dir.chdir(chefdk.join("embedded/apps")) do
248
- Tempfile.open("appbundle-updater") do |tempfile|
249
- tempfile.binmode
250
- URI.open(git_url) do |uri|
251
- tempfile.write(uri.read)
233
+ tmp_dir = Dir.mktmpdir
234
+ banner("Creating #{tmp_dir}/#{app.name} directory")
235
+ app_dir = File.join(tmp_dir, app.name.to_s)
236
+
237
+ begin
238
+ if tarball
239
+ # NOTE: THIS IS DELIBERATELY PURE RUBY USING NO NATIVE GEMS AND ONLY
240
+ # THE RUBY STDLIB BY DESIGN
241
+ git_url = "https://github.com/#{repo}/archive/#{ref}.tar.gz"
242
+ banner("Extracting #{app} from #{git_url}")
243
+ Dir.chdir(tmp_dir) do
244
+ Tempfile.open("appbundle-updater") do |tempfile|
245
+ tempfile.binmode
246
+ URI.open(git_url) do |uri|
247
+ tempfile.write(uri.read)
248
+ end
249
+ tempfile.close
250
+ extract_tgz(tempfile.path)
252
251
  end
253
- tempfile.close
254
- extract_tgz(tempfile.path)
252
+ base = File.basename repo
253
+ FileUtils.mv Dir.glob("#{base}-*")[0], app.name.to_s
254
+ end
255
+ else
256
+ git_url = "https://github.com/#{repo}.git"
257
+ banner("Cloning #{app} from #{git_url}")
258
+ run("git clone #{git_url} #{app_dir}")
259
+
260
+ banner("Checking out #{app} to #{ref}")
261
+ Dir.chdir(app_dir) do
262
+ run("git checkout #{ref}")
255
263
  end
256
- base = File.basename repo
257
- FileUtils.mv Dir.glob("#{base}-*")[0], "#{app.name}"
258
264
  end
259
- else
260
- git_url = "https://github.com/#{repo}.git"
261
- banner("Cloning #{app} from #{git_url}")
262
- run("git clone #{git_url} #{app_dir}")
263
265
 
264
- banner("Checking out #{app} to #{ref}")
266
+ banner("Installing dependencies")
265
267
  Dir.chdir(app_dir) do
266
- run("git checkout #{ref}")
268
+ # Use the bundler from Ruby package instead of from vendor/bin
269
+ bundle_executable = bundler_from_ruby_pkg
270
+ banner("Using bundler from Ruby package: #{bundle_executable}")
271
+ cmd = "#{bundle_executable} install"
272
+ cmd += " --without #{app.bundle_without}" if app.bundle_without
273
+ ruby(cmd)
267
274
  end
268
- end
269
275
 
270
- banner("Installing dependencies")
271
- Dir.chdir(app_dir) do
272
- cmd = "#{bin_dir.join("bundle")} install"
273
- cmd += " --without #{app.bundle_without}" if app.bundle_without
274
- ruby(cmd)
275
- end
276
-
277
- banner("Re-installing git-installed gems")
278
- Dir.chdir(app_dir) do
279
- ruby("post-bundle-install.rb #{chefdk}") if File.exist?("#{app_dir}/post-bundle-install.rb")
280
- end
281
-
282
- banner("Installing gem")
283
- Dir.chdir(app_dir) do
284
- Array(install_commands).each do |command|
285
- ruby(command)
276
+ banner("Re-installing git-installed gems")
277
+ Dir.chdir(app_dir) do
278
+ ruby("post-bundle-install.rb #{bin_dir}") if File.exist?("#{app_dir}/post-bundle-install.rb")
286
279
  end
287
- end
288
280
 
289
- banner("Updating appbundler binstubs for #{app}")
290
- if gems.empty?
281
+ banner("Installing gem")
291
282
  Dir.chdir(app_dir) do
292
- cmd = "#{bin_dir.join("appbundler")} #{app_dir} #{chefdk.join("bin")}"
293
- cmd += " --extra-bin-files #{@extra_bin_files}" if @extra_bin_files
294
- cmd += " --binstubs-source #{@binstubs_source}" if @binstubs_source
295
- ruby(cmd)
283
+ Array(install_commands).each do |command|
284
+ ruby(command)
285
+ end
296
286
  end
297
- else
298
- gems.each do |gem_name, without|
287
+
288
+ banner("Updating appbundler binstubs for #{app}")
289
+ if gems.empty?
299
290
  Dir.chdir(app_dir) do
300
- cmd = "#{bin_dir.join("appbundler")} #{app_dir} #{chefdk.join("bin")} #{gem_name}"
301
- cmd += " --without #{without.join(",")}" if without
291
+ cmd = "#{vendor_bin_dir.join("appbundler")} #{app_dir} #{bin_dir}"
302
292
  cmd += " --extra-bin-files #{@extra_bin_files}" if @extra_bin_files
303
293
  cmd += " --binstubs-source #{@binstubs_source}" if @binstubs_source
304
294
  ruby(cmd)
305
295
  end
296
+ else
297
+ gems.each do |gem_name, without|
298
+ Dir.chdir(app_dir) do
299
+ cmd = "#{vendor_bin_dir.join("appbundler")} #{app_dir} #{bin_dir} #{gem_name}"
300
+ cmd += " --without #{without.join(",")}" if without
301
+ cmd += " --extra-bin-files #{@extra_bin_files}" if @extra_bin_files
302
+ cmd += " --binstubs-source #{@binstubs_source}" if @binstubs_source
303
+ ruby(cmd)
304
+ end
305
+ end
306
306
  end
307
- end
308
307
 
309
- banner("Finished!")
308
+ rescue => e
309
+ puts "aborting!!", e
310
+ else
311
+ banner("Finished!")
312
+ ensure
313
+ banner("Cleaning up #{app_dir}")
314
+ FileUtils.remove_entry app_dir
315
+ banner("Done.")
316
+ end
310
317
  end
311
318
 
312
319
  private
313
320
 
314
- def app_dir
315
- chefdk.join("embedded/apps/#{app}")
316
- end
317
-
318
321
  def banner(msg)
319
322
  puts "-----> #{msg}"
320
323
  end
321
324
 
322
325
  def ruby(script)
323
- ruby = bin_dir.join("ruby").to_s.tap { |p| p.concat(".exe") if windows? }
324
-
325
- run([ruby, script].join(" "))
326
+ ruby_cmd = "hab pkg exec #{ruby_pkg} ruby"
327
+ run([ruby_cmd, script].join(" "))
326
328
  end
327
329
 
328
330
  end
@@ -356,7 +358,7 @@ class CLI
356
358
  end
357
359
  opts.separator("")
358
360
  opts.separator("App names:")
359
- CHEFDK_APPS.each { |a| opts.separator(" * #{a.name}") }
361
+ HABITAT_PACKAGES.each { |a| opts.separator(" * #{a.name}") }
360
362
  end
361
363
  @parser.parse!
362
364
  validate!
@@ -364,7 +366,7 @@ class CLI
364
366
 
365
367
  def validate!
366
368
  die("PROJECT APP_NAME GIT_REF options are all required") if ARGV.length < 3
367
- options[:app] = CHEFDK_APPS.find { |a| a.name == ARGV[1] }
369
+ options[:app] = HABITAT_PACKAGES.find { |a| a.name == ARGV[1] }
368
370
  die("Invalid APP_NAME: #{ARGV[1]}") if options[:app].nil?
369
371
  options[:ref] = ARGV[2]
370
372
  end
@@ -1,3 +1,3 @@
1
1
  module AppbundleUpdater
2
- VERSION = "1.0.36".freeze
2
+ VERSION = "19.0.4".freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: appbundle-updater
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.36
4
+ version: 19.0.4.rc.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - lamont-granquist
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-02-09 00:00:00.000000000 Z
11
+ date: 2025-06-17 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: Updates appbundled apps in Chef's omnibus packages
14
14
  email:
@@ -46,11 +46,11 @@ required_ruby_version: !ruby/object:Gem::Requirement
46
46
  version: '0'
47
47
  required_rubygems_version: !ruby/object:Gem::Requirement
48
48
  requirements:
49
- - - ">="
49
+ - - ">"
50
50
  - !ruby/object:Gem::Version
51
- version: '0'
51
+ version: 1.3.1
52
52
  requirements: []
53
- rubygems_version: 3.1.4
53
+ rubygems_version: 3.3.27
54
54
  signing_key:
55
55
  specification_version: 4
56
56
  summary: Updates appbundled apps in Chef's omnibus packages