bundler

package module
v0.0.118 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 23, 2020 License: Apache-2.0 Imports: 16 Imported by: 0

README

Bundler Cloud Native Buildpack

The Bundler CNB provides the Bundler binary. The buildpack installs the Bundler onto the $PATH and $GEM_PATH which makes it available for subsequent buildpacks and in the final running container.

Integration

The Bundler CNB provides bundler as a dependency. Downstream buildpacks, can require the bundler dependency by generating a Build Plan TOML file that looks like the following:

[[requires]]

  # The name of the Bundler dependency is "bundler". This value is considered
  # part of the public API for the buildpack and will not change without a plan
  # for deprecation.
  name = "bundler"

  # The version of the Bundler dependency is not required. In the case it
  # is not specified, the buildpack will provide the default version, which can
  # be seen in the buildpack.toml file.
  # If you wish to request a specific version, the buildpack supports
  # specifying a semver constraint in the form of "1.*", "1.17.*", or even
  # "1.17.1".
  version = "1.17.1"

  # The Bundler buildpack supports some non-required metadata options.
  [requires.metadata]

    # Setting the build flag to true will ensure that the Bundler
    # depdendency is available on the $PATH for subsequent buildpacks during
    # their build phase. If you are writing a buildpack that needs to run Bundle
    # during its build process, this flag should be set to true.
    build = true

To package this buildpack for consumption:

$ ./scripts/package.sh

This builds the buildpack's Go source using GOOS=linux by default. You can supply another value as the first argument to package.sh.

Documentation

Index

Constants

View Source
const (
	Bundler            = "bundler"
	BuildpackYMLSource = "buildpack.yml"
	GemfileLockSource  = "Gemfile.lock"
	GemfileSource      = "Gemfile"

	DepKey = "dependency-sha"
)
View Source
const VersionShimTemplate = "#!/usr/bin/env sh\nexec %s _%s_ ${@:-}"

Variables

This section is empty.

Functions

func Build

func Build(
	entries EntryResolver,
	dependencies DependencyManager,
	planRefinery BuildPlanRefinery,
	logger LogEmitter,
	clock chronos.Clock,
	versionShimmer Shimmer,
) packit.BuildFunc

func Detect

func Detect(buildpackYMLParser, gemfileLockParser VersionParser) packit.DetectFunc

Types

type BuildPlanMetadata

type BuildPlanMetadata struct {
	VersionSource string `toml:"version-source"`
}

type BuildPlanRefinery

type BuildPlanRefinery interface {
	BillOfMaterial(dependency postal.Dependency) packit.BuildpackPlan
}

type BuildpackYMLParser

type BuildpackYMLParser struct{}

func NewBuildpackYMLParser

func NewBuildpackYMLParser() BuildpackYMLParser

func (BuildpackYMLParser) ParseVersion

func (p BuildpackYMLParser) ParseVersion(path string) (string, error)

type Config

type Config struct {
	Version string `yaml:"version"`
}

type DependencyManager

type DependencyManager interface {
	Resolve(path, id, version, stack string) (postal.Dependency, error)
	Install(dependency postal.Dependency, cnbPath, layerPath string) error
}

type EntryResolver

type EntryResolver interface {
	Resolve([]packit.BuildpackPlanEntry) packit.BuildpackPlanEntry
}

type GemfileLockParser

type GemfileLockParser struct{}

func NewGemfileLockParser

func NewGemfileLockParser() GemfileLockParser

func (GemfileLockParser) ParseVersion

func (p GemfileLockParser) ParseVersion(path string) (string, error)

type LogEmitter

type LogEmitter struct {
	// Logger is embedded and therefore delegates all of its functions to the
	// LogEmitter.
	scribe.Logger
}

func NewLogEmitter

func NewLogEmitter(output io.Writer) LogEmitter

func (LogEmitter) Candidates

func (e LogEmitter) Candidates(entries []packit.BuildpackPlanEntry)

func (LogEmitter) Environment

func (l LogEmitter) Environment(env packit.Environment)

func (LogEmitter) SelectedDependency

func (e LogEmitter) SelectedDependency(entry packit.BuildpackPlanEntry, dependency postal.Dependency, now time.Time)

type PlanEntryResolver

type PlanEntryResolver struct {
	// contains filtered or unexported fields
}

func NewPlanEntryResolver

func NewPlanEntryResolver(logger LogEmitter) PlanEntryResolver

func (PlanEntryResolver) Resolve

type PlanRefinery

type PlanRefinery struct{}

func NewPlanRefinery

func NewPlanRefinery() PlanRefinery

func (PlanRefinery) BillOfMaterial

func (pf PlanRefinery) BillOfMaterial(dependency postal.Dependency) packit.BuildpackPlan

type Shimmer

type Shimmer interface {
	Shim(path, version string) error
}

type VersionParser

type VersionParser interface {
	ParseVersion(path string) (version string, err error)
}

type VersionShimmer

type VersionShimmer struct{}

func NewVersionShimmer

func NewVersionShimmer() VersionShimmer

func (VersionShimmer) Shim

func (s VersionShimmer) Shim(dir, version string) error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL