lib/dockistrano/service_dependency.rb
def load_from_image
      raw_config = Docker.run(backing_service.full_image_name, command: "cat /dockistrano.yml", rm: true)
      if raw_config.empty? or raw_config.include?("No such file or directory")
        if raw_config.include?("failed to mount")
          raise HostDirectoriesMissing
        else
          raise ContainerConfigurationMissing
        end
      else
        FileUtils.mkdir_p("tmp/configuration_cache")
        file = File.open("tmp/configuration_cache/#{backing_service.image_id}", "w+")
        file.write(raw_config)
        file.close

        config = YAML.load(raw_config)
      end
    end
# Creates a new service instance based on the name and configuration. When
# configuration is not local, the configuration is fetched from Github and
# processed.
# In some cases, you only need an uninitialized version of a dependency, for
# example when pulling new versions of images. Provide initialize=false to
# skip tag detection and configuration loading from the image.
Creates a new service instance based on the name and configuration. When
configuration is not local, the configuration is fetched from Github and
processed.
In some cases, you only need an uninitialized version of a dependency, for
example when pulling new versions of images. Provide initialize=false to
skip tag detection and configuration loading from the image.
Creates a new service instance based on the name and configuration . When configuration is not local the configuration is fetched from Github and processed . In some cases you only need an uninitialized version of a dependency for example when pulling new versions of images . Provide initialize = false to skip tag detection and configuration loading from the image .
def load_from_image
      raw_config = Docker.run(backing_service.full_image_name, command: "cat /dockistrano.yml", rm: true)
      if raw_config.empty? or raw_config.include?("No such file or directory")
        if raw_config.include?("failed to mount")
          raise HostDirectoriesMissing
        else
          raise ContainerConfigurationMissing
        end
      else
        FileUtils.mkdir_p("tmp/configuration_cache")
        file = File.open("tmp/configuration_cache/#{backing_service.image_id}", "w+")
        file.write(raw_config)
        file.close
        config = YAML.load(raw_config)
      end
    end
def load_from_image raw_config = Docker . run ( backing_service . full_image_name , command : "cat /dockistrano.yml" , rm : true ) if raw_config . empty? or raw_config . include? ( "No such file or directory" ) if raw_config . include? ( "failed to mount" ) raise HostDirectoriesMissing else raise ContainerConfigurationMissing end else FileUtils . mkdir_p ( "tmp/configuration_cache" ) file = File . open ( "tmp/configuration_cache/#{backing_service.image_id}" , "w+" ) file . write ( raw_config ) file . close config = YAML . load ( raw_config ) end end
Creates a new service instance based on the name and configuration.
Creates a new service instance based on the name and configuration .