lib/mixlib/install/generator/bourne.rb in mixlib-install-0.8.0.alpha.2 vs lib/mixlib/install/generator/bourne.rb in mixlib-install-0.8.0.alpha.3

- old
+ new

@@ -13,32 +13,44 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. # +require "mixlib/install/generator/base" +require "mixlib/install/backend/artifactory" + module Mixlib class Install class Generator - class Bourne - attr_reader :options + class Bourne < Base + def self.install_sh(context) + install_command = [] + install_command << get_script("helpers.sh") + install_command << get_script("script_cli_parameters.sh") + install_command << get_script("platform_detection.sh") + install_command << get_script("fetch_metadata.sh", context) + install_command << get_script("fetch_package.sh") + install_command << get_script("install_package.sh") + install_command.join("\n\n") + end - def initialize(options) - @options = options + def self.script_base_path + File.join(File.dirname(__FILE__), "bourne/scripts") end def install_command install_command = [] - install_command << get_script(:helpers) + install_command << get_script("helpers.sh") install_command << render_variables - install_command << get_script(:platform_detection) + install_command << get_script("platform_detection.sh") if options.for_artifactory? install_command << artifactory_urls else - install_command << get_script(:fetch_metadata) + install_command << get_script("fetch_metadata.sh") end - install_command << get_script(:fetch_package) - install_command << get_script(:install_package) + install_command << get_script("fetch_package.sh") + install_command << get_script("install_package.sh") install_command.join("\n\n") end def render_variables @@ -48,14 +60,11 @@ channel=#{options.channel} EOS end def artifactory_urls - raise "not implemented yet" - end - - def get_script(name) - File.read(File.join(File.dirname(__FILE__), "bourne/scripts/#{name}.sh")) + artifacts = Mixlib::Install::Backend::Artifactory.new(options).info + get_script("artifactory_urls.sh", artifacts: artifacts) end end end end end