dotnetcoreaspnetruntime

package module
v0.0.0-...-6272b85 Latest Latest
Warning

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

Go to latest
Published: Apr 18, 2024 License: Apache-2.0 Imports: 20 Imported by: 0

README

Paketo Buildpack for ASP.NET Core Runtime

The ASP.NET Core Runtime CNB provides a version of the ASP.NET Core Runtime. The ASP.NET Core Runtime dependency will be made available on the $PATH and $DOTNET_ROOT at run-time for .NET Core apps containing a *.runtimeconfig.json file with runtime frameworks specified.

The buildpack is published for consumption as an image at paketobuildpacks/dotnet-core-aspnet-runtime. It is a part of the Paketo Buildpack for .NET Core, which is a top-level language family buildpack that leverages all related .NET Core buildpacks together.

Integration

The ASP.NET Core Runtime CNB provides dotnet-core-aspnet-runtime as a dependency. Downstream buildpacks, like .NET Core Execute can require the dotnet-core-aspnet-runtime dependency by generating a Build Plan TOML file that looks like the following:

[[requires]]

  # The name of the ASP.NET Core Runtime dependency is "dotnet-core-aspnet-runtime".
  # This value is considered part of the public API for the buildpack and will
  # not change without a plan for deprecation.
  name = "dotnet-core-aspnet-runtime"

  # The ASP.NET Core Runtime buildpack supports some non-required metadata options.
  [requires.metadata]

    # Setting the launch flag to true will ensure that the ASP.NET Core Runtime
    # dependency is available on the $PATH and $DOTNET_ROOT for the running
    # application. If you are writing an application that needs to run ASP.NET
    # Runtime at runtime, this flag should be set to true.
    launch = true

    # Setting the build flag to true will ensure that the ASP.NET Core Runtime
    # dependency is available to subsequent buildpacks during their build phase.
    # This is NOT recommended, because most .NET Core apps will also need the
    # .NET Core SDK dependency during build-time. The dotnet-core-sdk
    # dependency (provided by the separate .NET Core SDK buildpack) includes the
    # SDK, as well as the ASP.NET Core Runtime and should be used instead.
    build = true

    # The version of the ASP.NET Core Runtime dependency is not required. In the
    # case it is not specified, the buildpack will determine and provide a
    # version based off of the *runtimeconfig.json file. If you wish to request a
    # specific version, the buildpack supports specifying a semver constraint in
    # the form of "6.*", "6.0.*", or even "6.0.5".
    version = "6.0.5"

Configuration

BP_DOTNET_FRAMEWORK_VERSION

The BP_DOTNET_FRAMEWORK_VERSION variable allows you to specify the version of ASP.NET Core Runtime that is installed. The environment variable can be set at build-time either directly (ex. pack build my-app --env BP_ENVIRONMENT_VARIABLE=some-value) or through a project.toml file

BP_DOTNET_FRAMEWORK_VERSION=6.0.5
BP_LOG_LEVEL

The BP_LOG_LEVEL variable allows you to configure the level of log output from the buildpack itself. The environment variable can be set 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"

Usage

To package this buildpack for consumption:

$ ./scripts/package.sh --version <version-number>

This will create a buildpackage.cnb file under the build directory which you can use to build your app as follows: pack build <app-name> -p <path-to-app> -b build/buildpackage.cnb -b <other-buildpacks..>

To run the unit and integration tests for this buildpack:

$ ./scripts/unit.sh && ./scripts/integration.sh

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Build

func Build(
	entries EntryResolver,
	dependencies DependencyManager,
	versionResolver VersionResolver,
	sbomGenerator SBOMGenerator,
	configParser ConfigParser,
	logger scribe.Emitter,
	clock chronos.Clock,
) packit.BuildFunc

func Detect

func Detect(environment Environment, versionParser VersionParser) packit.DetectFunc

Types

type BuildpackYMLParser

type BuildpackYMLParser struct{}

func NewBuildpackYMLParser

func NewBuildpackYMLParser() BuildpackYMLParser

func (BuildpackYMLParser) ParseVersion

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

type ConfigParser

type ConfigParser interface {
	Parse(runtimeConfigFileGlob string) (string, error)
}

type DependencyManager

type DependencyManager interface {
	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 Environment

type Environment struct {
	DotnetRollForward      string `env:"BP_DOTNET_ROLL_FORWARD"`
	DotnetFrameworkVersion string `env:"BP_DOTNET_FRAMEWORK_VERSION"`
}

type RuntimeConfigParser

type RuntimeConfigParser struct{}

func NewRuntimeConfigParser

func NewRuntimeConfigParser() RuntimeConfigParser

func (RuntimeConfigParser) Parse

func (p RuntimeConfigParser) Parse(glob string) (string, error)

type RuntimeVersionResolver

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

func NewRuntimeVersionResolver

func NewRuntimeVersionResolver(logger scribe.Emitter, environment Environment) RuntimeVersionResolver

func (RuntimeVersionResolver) Resolve

func (r RuntimeVersionResolver) Resolve(path string, entry packit.BuildpackPlanEntry, stack string) (postal.Dependency, error)

type SBOMGenerator

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

type VersionParser

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

type VersionResolver

type VersionResolver interface {
	Resolve(path string, entry packit.BuildpackPlanEntry, stack string) (postal.Dependency, 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