class Dock0::Install

An Install is a deployment of components onto a system

Public Instance Methods

artifacts() click to toggle source
# File lib/dock0/install.rb, line 27
def artifacts
  @config[:artifacts].map do |artifact|
    artifact[:url] ||= build_url(artifact)
    artifact
  end
end
build_url(artifact) click to toggle source
# File lib/dock0/install.rb, line 21
def build_url(artifact)
  org = artifact[:org] || @config[:org]
  name, version, file = artifact.values_at(:name, :version, :file)
  "https://github.com/#{org}/#{name}/releases/download/#{version}/#{file}"
end
default_config() click to toggle source
# File lib/dock0/install.rb, line 8
def default_config
  {
    paths: {
      templates: './templates',
      scripts: './scripts',
      build: './build',
      base: '/'
    },
    org: 'dock0',
    artifacts: []
  }
end
easy_mode() click to toggle source
# File lib/dock0/install.rb, line 41
def easy_mode
  load_artifacts
  render_templates('')
  run_scripts
end
load_artifacts() click to toggle source
# File lib/dock0/install.rb, line 34
def load_artifacts
  Dir.chdir("#{@paths[:build]}/#{@paths[:base]}") do
    menagerie = Menagerie.new @config[:menagerie]
    menagerie.add_release artifacts
  end
end