'Publishes the yaml configuration consumed by Halyard for the component.
Args:
component [string]: Name of the Spinnaker component.
profile_path [string]: Path to component\'s yaml configuration file.'

def __publish_config(self, component, profile_path):

    for profile in os.listdir(profile_path):
        full_profile = os.path.join(profile_path, profile)
        if os.path.isfile(full_profile):
            self.__hal_upload_profile(component, self.__bom_file, full_profile)
        elif os.path.isdir(full_profile):
            tar_path = '{0}.tar.gz'.format(full_profile)
            result = run_quick('tar    -cvf    {0}    -C    {1}    $(ls    {1})'.format(tar_path, full_profile))
            if (result.returncode != 0):
                print "Creating    a    tar    archive    of    '{0}/*'    failed    with    \n{1}\nexiting...".format(full_profile, result.stdout)
                exit(result.returncode)
            self.__hal_upload_profile(component, self.__bom_file, tar_path)
        else:
            print 'Listed    profile    was    neither    a    file    nor    a    directory.    Ignoring...'
            continue
