mri

package module
v0.9.1 Latest Latest
Warning

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

Go to latest
Published: Nov 9, 2022 License: Apache-2.0 Imports: 14 Imported by: 0

README

Paketo Buildpack for MRI

gcr.io/paketo-buildpacks/mri

The MRI CNB provides the Matz's Ruby Interpreter (or MRI). The buildpack installs MRI onto the $PATH which makes it available for subsequent buildpacks and in the final running container. It also sets the $GEM_PATH environment variable.

Integration

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

[[requires]]
  # The name of the MRI dependency is "mri". This value is considered
  # part of the public API for the buildpack and will not change without a plan
  # for deprecation.
  name = "mri"
  # The version of the MRI 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 "2.*", "2.7.*", or even
  # "2.7.1".
  version = "2.7.1"
  # The MRI buildpack supports some non-required metadata options.
  [requires.metadata]
    # Setting the build flag to true will ensure that the MRI
    # depdendency is available on the $PATH for subsequent buildpacks during
    # their build phase. If you are writing a buildpack that needs to use MRI
    # during its build process, this flag should be set to true.
    build = true

Usage

To package this buildpack for consumption:

$ ./scripts/package.sh

MRI Configurations

Specifying the MRI version through buildpack.yml configuration will be deprecated in MRI Buildpack v1.0.0.

To migrate from using buildpack.yml please set the $BP_MRI_VERSION environment variable at build time either directly (ex. pack build my-app --env BP_MRI_VERSION=2.7.*) or through a project.toml file

$BP_MRI_VERSION="2.7.1"

This will replace the following structure in buildpack.yml:

mri:
  version: 2.7.1

Logging Configurations

To configure the level of log output from the buildpack itself, set the $BP_LOG_LEVEL environment variable at build time either directly (ex. pack build my-app --env BP_LOG_LEVEL=DEBUG) or through a project.toml file If no value is set, the default value of INFO will be used.

The options for this setting are:

  • INFO: (Default) log information about the progress of the build process
  • DEBUG: log debugging information about the progress of the build process
$BP_LOG_LEVEL="DEBUG"

Development

Paketo buildpacks are going through an uniformization of the dev experience across buildpacks, for now just check the scripts/ folder.

Documentation

Index

Constants

View Source
const (
	MRI                = "mri"
	BuildpackYMLSource = "buildpack.yml"

	DepKey = "dependency-sha"
)

Variables

This section is empty.

Functions

func Build

func Build(
	entries EntryResolver,
	dependencies DependencyManager,
	gem Executable,
	sbomGenerator SBOMGenerator,
	logger scribe.Emitter,
	clock chronos.Clock,
) packit.BuildFunc

func Detect

func Detect(buildpackYMLParser VersionParser) packit.DetectFunc

Types

type BuildPlanMetadata

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

type BuildpackYMLParser

type BuildpackYMLParser struct{}

func NewBuildpackYMLParser

func NewBuildpackYMLParser() BuildpackYMLParser

func (BuildpackYMLParser) ParseVersion

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

type DependencyManager

type DependencyManager interface {
	Resolve(path, id, version, stack string) (postal.Dependency, error)
	Deliver(dependency postal.Dependency, cnbPath, layerPath, platformPath string) error
	GenerateBillOfMaterials(dependencies ...postal.Dependency) []packit.BOMEntry
}

type EntryResolver

type EntryResolver interface {
	Resolve(string, []packit.BuildpackPlanEntry, []interface{}) (packit.BuildpackPlanEntry, []packit.BuildpackPlanEntry)
	MergeLayerTypes(string, []packit.BuildpackPlanEntry) (launch, build bool)
}

type Executable

type Executable interface {
	Execute(pexec.Execution) error
}

type SBOMGenerator added in v0.8.0

type SBOMGenerator interface {
	GenerateFromDependency(dependency postal.Dependency, dir string) (sbom.SBOM, error)
}

type VersionParser

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

Directories

Path Synopsis
dependency
retrieval module

Jump to

Keyboard shortcuts

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