lib/liberty_buildpack/container/feature_manager.rb
# download and install any features configured in server.xml that are not
# already present in the liberty server by invoking liberty's
# featureManager with the list of all features, and letting it determine
# the missing features and then download these from the liberty feature
# repository.
download and install any features configured in server.xml that are not
already present in the liberty server by invoking liberty's
featureManager with the list of all features, and letting it determine
the missing features and then download these from the liberty feature
repository.
download and install any features configured in server . xml that are not already present in the liberty server by invoking liberty ' s featureManager with the list of all features and letting it determine the missing features and then download these from the liberty feature repository .
def download_and_install_features(server_xml, liberty_home)
        @logger.debug('entry')
        if use_liberty_repository?
          features = get_features(server_xml)
          jvm_args = get_jvm_args
          cmd = File.join(liberty_home, 'bin', 'featureManager')
          script_string = "JAVA_HOME=\"#{@app_dir}/#{@java_home}\" JVM_ARGS=#{jvm_args} #{cmd} install --acceptLicense #{features} --when-file-exists=replace"
          @logger.debug("script invocation string is #{script_string}")
          output = `#{script_string}`
          if output.include?(FEATURES_ALREADY_PRESENT_MSG_CODE)
            @logger.debug("no extra features to install, output is #{output}")
          elsif output.include?(FEATURES_INSTALLED_MSG_CODE)
            @logger.debug("installed required features, output is #{output}")
          else
            @logger.debug("could not install required features, output is #{output}")
            raise "could not install required features, output is #{output}"
          end
        end
        @logger.debug('exit')
      end
def download_and_install_features ( server_xml , liberty_home ) @logger . debug ( 'entry' ) if use_liberty_repository? features = get_features ( server_xml ) jvm_args = get_jvm_args cmd = File . join ( liberty_home , 'bin' , 'featureManager' ) script_string = "JAVA_HOME=\"#{@app_dir}/#{@java_home}\" JVM_ARGS=#{jvm_args} #{cmd} install --acceptLicense #{features} --when-file-exists=replace" @logger . debug ( "script invocation string is #{script_string}" ) output = ` #{ script_string } ` if output . include? ( FEATURES_ALREADY_PRESENT_MSG_CODE ) @logger . debug ( "no extra features to install, output is #{output}" ) elsif output . include? ( FEATURES_INSTALLED_MSG_CODE ) @logger . debug ( "installed required features, output is #{output}" ) else @logger . debug ( "could not install required features, output is #{output}" ) raise "could not install required features, output is #{output}" end end @logger . debug ( 'exit' ) end
download and install any features configured in server.xml that are not
already present in the liberty server by invoking liberty's
featureManager with the list of all features, and letting it determine
the missing features and then download these from the liberty feature
repository.
download and install any features configured in server . xml that are not already present in the liberty server by invoking liberty ' s featureManager with the list of all features and letting it determine the missing features and then download these from the liberty feature repository .
# if ($CHILD_STATUS.to_i == 0) doesn't seem to work, as $CHILD_STATUS is # nil, so parse output for known message codes.
server_xml
liberty_home