dotnetcoresdk

package module
v0.1.5 Latest Latest
Warning

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

Go to latest
Published: Feb 9, 2021 License: Apache-2.0 Imports: 15 Imported by: 0

README

Dotnet Core SDK Cloud Native Buildpack

The Dotnet Core SDK CNB provides a version of the Dotnet Core SDK and a version of the Dotnet Core Driver or the dotnet binary. It also sets the Dotnet Core SDK on the$DOTNET_ROOT so that it is available to subsequent buildpacks during their build phase and sets the Dotnet Core Driver on the $PATH so that is available to subsequent buildpacks and in the final running container.

Integration

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

[[requires]]

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

  # The version of the Dotnet Core SDK 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 "3.*", "3.1.*", or even
  # "3.1.100".
  version = "3.1.100"

  # The Dotnet Core SDK buildpack supports some non-required metadata options.
  [requires.metadata]

    # Setting the build flag to true will ensure that the Dotnet Core SDK
    # depdendency is available in the $DOTNET_ROOT for subsequent buildpacks during
    # their build phase and ensures that the Dotnet Core Driver dependency is available
    # in the $PATH for subsequent buildpacks. If you are writing a buildpack that needs
    # to use the dotnet sdk & driver during its build process, this flag should be set
    # to true.
    build = true

Usage

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.

buildpack.yml Configurations

dotnet-sdk:
  # this allows you to specify a version constaint for the dotnet-sdk dependency
  # any valid semver constaints (e.g. 2.* and 2.1.*) are also acceptable
  version: "2.1.804"

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Build

func Build(entryResolver EntryResolver,
	dependencyMapper DependencyMapper,
	buildPlanRefinery BuildPlanRefinery,
	dependencyManager DependencyManager,
	dotnetSymlinker DotnetSymlinker,
	logger LogEmitter,
	clock chronos.Clock,
) packit.BuildFunc

func Detect

func Detect(buildpackYMLParser BuildpackYMLParser) packit.DetectFunc

Types

type BuildPlanRefinery

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

type BuildpackYMLParser

type BuildpackYMLParser interface {
	Parse(workingDir 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
}

type DependencyMapper

type DependencyMapper interface {
	FindCorrespondingVersion(path, versionKey string) (string, error)
}

type DotnetSymlinker

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

type EntryResolver

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

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) Candidates

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

func (LogEmitter) Environment

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

func (LogEmitter) SelectedDependency

func (l 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 (r PlanRefinery) BillOfMaterial(dependency postal.Dependency) packit.BuildpackPlanEntry

type RuntimeToSdks

type RuntimeToSdks struct {
	RuntimeVersion string   `toml:"runtime-version"`
	SDKs           []string `toml:"sdks"`
}

type SDKVersionMapper

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

func NewSDKVersionMapper

func NewSDKVersionMapper(logger LogEmitter) SDKVersionMapper

func (SDKVersionMapper) FindCorrespondingVersion

func (r SDKVersionMapper) FindCorrespondingVersion(path, versionKey string) (string, error)

type SdkVersionParser

type SdkVersionParser struct{}

func NewSdkVersionParser

func NewSdkVersionParser() SdkVersionParser

func (SdkVersionParser) Parse

func (p SdkVersionParser) Parse(workingDir string) (string, error)

type Symlinker

type Symlinker struct{}

func NewSymlinker

func NewSymlinker() Symlinker
func (s Symlinker) Link(workingDir, layerPath string) error

Directories

Path Synopsis
actions
dependency
retrieval Module

Jump to

Keyboard shortcuts

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