class FPM::Fry::Recipe

A FPM::Fry::Recipe contains all information needed to build a package.

It is usually created by {FPM::Fry::Recipe::Builder}.

Attributes

before_build_steps[RW]

@return [Array<#to_s>] steps that will be carried out before build

before_dependencies_steps[RW]

@return [Array<#to_s>] steps that will be carried out before dependencies are installed

build_depends[RW]

@return [Hash<String,Hash>] build dependencies

build_mounts[RW]
dockerfile_hooks[RW]

@return [Array<#call>] hooks that will be called when building the Dockerfile

input_hooks[RW]

@return [Array<#call>] hooks that will be called on the input package

packages[RW]

@return [Array<FPM::Fry::PackageRecipe>] a list of packages that will be created

source[RW]

@return [FPM::Fry::Source] the source used for building

steps[RW]

@return [Array<#to_s>] steps that will be carried out during build

Public Class Methods

new() click to toggle source
# File lib/fpm/fry/recipe.rb, line 159
def initialize
  @source = Source::Null
  @before_dependencies_steps = []
  @before_build_steps = []
  @steps = []
  @packages = [PackageRecipe.new]
  @packages[0].files << '**'
  @build_depends = {}
  @input_hooks = []
  @dockerfile_hooks = []
  @build_mounts = []
end

Public Instance Methods

apply_dockerfile_hooks( df ) click to toggle source

Filters the dockerfile @api experimental @param [Hash] df

# File lib/fpm/fry/recipe.rb, line 199
def apply_dockerfile_hooks( df )
  dockerfile_hooks.each do |hook|
    hook.call(self, df)
  end
  return nil
end
apply_input( package ) click to toggle source

Applies input settings to package @param [FPM::Package] package @return [FPM::Package]

# File lib/fpm/fry/recipe.rb, line 191
def apply_input( package )
  input_hooks.each{|h| h.call(self, package) }
  return package
end
depends() click to toggle source

Calculates all dependencies of this recipe @return [Hash<String,Hash>] the dependencies

# File lib/fpm/fry/recipe.rb, line 174
def depends
  depends = @packages.map(&:depends).inject(:merge)
  @packages.map(&:name).each do | n |
    depends.delete(n)
  end
  return depends
end
lint() click to toggle source

Checks all packages for common errors @return [Array<String>] problems

# File lib/fpm/fry/recipe.rb, line 184
def lint
  packages.flat_map(&:lint)
end