Support appbundler 0.11.0

Support for chef-dk 2.0 style appbundling.

This has been in use for nearly a year and we've been living off of a
branch and its necessary to get this mainlined now.
Signed-off-by: default avatarLamont Granquist <lamont@scriptkiddie.org>
parent 7f3652f8
#
# Copyright 2012-2014 Chef Software, Inc.
# Copyright 2012-2018, Chef Software Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
......@@ -372,19 +372,31 @@ module Omnibus
# @param (see #command)
# @return (see #command)
#
def appbundle(software_name, options = {})
def appbundle(software_name, lockdir: nil, gem: nil, without: nil, **options)
build_commands << BuildCommand.new("appbundle `#{software_name}'") do
app_software = project.softwares.find do |p|
p.name == software_name
end
bin_dir = "#{install_dir}/bin"
appbundler_bin = embedded_bin("appbundler")
gem ||= software_name
lockdir ||=
begin
app_software = project.softwares.find do |p|
p.name == software_name
end
if app_software.nil?
raise "could not find software definition for #{software_name}, add a dependency to it, or pass a lockdir argument to appbundle command."
end
app_software.project_dir
end
command = [ appbundler_bin, "'#{lockdir}'", "'#{bin_dir}'", "'#{gem}'" ]
command << [ "--without", without.join(",") ] unless without.nil?
# Ensure the main bin dir exists
FileUtils.mkdir_p(bin_dir)
shellout!("#{appbundler_bin} '#{app_software.project_dir}' '#{bin_dir}'", options)
shellout!(command.join(" "), options)
end
end
expose :appbundle
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment