dotnetcoreaspnet

package module
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Nov 17, 2021 License: Apache-2.0 Imports: 11 Imported by: 0

README

ASPNet Cloud Native Buildpack

The Dotnet Core ASPNet CNB provides a version of the Dotnet Core ASPNet Framework and sets an extension of the $DOTNET_ROOT location.

A usage example can be found in the samples repository under the dotnet-core/aspnet directory.

Integration

The Dotnet Core ASPNet CNB provides dotnet-aspnetcore as a dependency. Downstream buildpacks, like Dotnet Core Build and Dotnet Core SDK can require the dotnet-aspnetcore dependency by generating a Build Plan TOML file that looks like the following:

[[requires]]

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

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

    # Setting the build flag to true will ensure that the ASPNet
    # dependency is available to subsequent buildpacks during their build phase.
    # Currently we do not recommend having your application directly interface with
    # the framework, instead use the dotnet-core-sdk. However,
    # if you are writing a buildpack that needs to use the ASPNet during
    # its build process, this flag should be set to true.
    build = true

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

    # The version of the ASPNet 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.1.*", or even
    # "2.1.15".
    version = "2.1.15"

To package this buildpack for consumption:

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

Configuration

Specifying the .NET Framework Version through buildpack.yml configuration will be deprecated in .NET Core ASPNet Buildpack v1.0.0.

To migrate from using buildpack.yml please set the following environment variables 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

The BP_DOTNET_FRAMEWORK_VERSION variable allows you to specify the version of .NET Core ASPNet that is installed.

BP_DOTNET_FRAMEWORK_VERSION=5.0.4

This will replace the following structure in buildpack.yml:

dotnet-framework:
  version: "5.0.4"

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Build

func Build(entries EntryResolver, dependencies DependencyManager, symlinker Symlinker, logger LogEmitter, clock chronos.Clock) packit.BuildFunc

func Detect

func Detect(buildpackYMLParser 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 DependencyManager

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

type DotnetRootLinker

type DotnetRootLinker struct{}

func NewDotnetRootLinker

func NewDotnetRootLinker() DotnetRootLinker
func (dl DotnetRootLinker) Link(workingDir, layerPath string) error

type EntryResolver

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

type LogEmitter

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

func NewLogEmitter

func NewLogEmitter(output io.Writer) LogEmitter

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 Symlinker

type Symlinker interface {
	Link(workingDir, layerPath string) (Err error)
}

type VersionParser

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

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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