dotnetpublish

package module
v1.0.3 Latest Latest
Warning

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

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

README

Dotnet Publish Cloud Native Buildpack

The Dotnet Publish CNB requires a set of buildpacks and then compiles the application that it has been given.

Integration

The Dotnet Publish CNB provides build dependency. The build dependency can required by generating a Build Plan TOML file that looks like the following:

[[requires]]

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

  # Note: The version field is unsupported as there is no version for a set of
  # build.

  # The Dotnet Publish CNB does not support non-required metadata options.

Configuration

BP_DOTNET_PROJECT_PATH

To specify a project subdirectory to be used as the root of the app, please use the BP_DOTNET_PROJECT_PATH environment variable at build time either directly (e.g. pack build my-app --env BP_DOTNET_PROJECT_PATH=./src/my-app) or through a project.toml file.

BP_DOTNET_PROJECT_PATH=./src/my-app

Usage

To package this buildpack for consumption:

$ ./scripts/package.sh

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Build

func Build(
	config Configuration,
	sourceRemover SourceRemover,
	bindingResolver BindingResolver,
	homeDir string,
	symlinker SymlinkManager,
	publishProcess PublishProcess,
	slicer Slicer,
	clock chronos.Clock,
	logger scribe.Emitter,
	sbomGenerator SBOMGenerator,
) packit.BuildFunc

func Detect

func Detect(config Configuration, parser ProjectParser) packit.DetectFunc

Types

type BindingResolver added in v0.6.0

type BindingResolver interface {
	Resolve(typ, provider, platformDir string) ([]servicebindings.Binding, error)
}

type BuildPlanMetadata

type BuildPlanMetadata struct {
	Version       string `toml:"version,omitempty"`
	VersionSource string `toml:"version-source,omitempty"`
	Build         bool   `toml:"build"`
	Launch        bool   `toml:"launch"`
}

type Configuration added in v0.9.1

type Configuration struct {
	LogLevel             string `env:"BP_LOG_LEVEL"`
	DebugEnabled         bool   `env:"BP_DEBUG_ENABLED"`
	DisableOutputSlicing bool   `env:"BP_DOTNET_DISABLE_BUILDPACK_OUTPUT_SLICING"`
	ProjectPath          string `env:"BP_DOTNET_PROJECT_PATH"`
	PublishFlags         []string
	RawPublishFlags      string `env:"BP_DOTNET_PUBLISH_FLAGS"`
}

type DotnetPublishProcess

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

func NewDotnetPublishProcess

func NewDotnetPublishProcess(executable Executable, logger scribe.Emitter, clock chronos.Clock) DotnetPublishProcess

func (DotnetPublishProcess) Execute

func (p DotnetPublishProcess) Execute(workingDir, nugetCachePath, projectPath, outputPath string, debug bool, flags []string) error

type DotnetSourceRemover added in v0.1.1

type DotnetSourceRemover struct{}

func NewDotnetSourceRemover added in v0.1.1

func NewDotnetSourceRemover() DotnetSourceRemover

func (DotnetSourceRemover) Remove added in v0.1.1

func (m DotnetSourceRemover) Remove(workingDir, publishOutputDir string, excludedFiles ...string) error

type Executable

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

type OutputSlicer added in v0.7.3

type OutputSlicer struct{}

func NewOutputSlicer added in v0.7.3

func NewOutputSlicer() OutputSlicer

func (OutputSlicer) Slice added in v0.7.3

func (s OutputSlicer) Slice(assetsFile string) (pkgs, earlyPkgs, projects packit.Slice, err error)

type ProjectFileParser added in v0.0.122

type ProjectFileParser struct{}

func NewProjectFileParser added in v0.0.122

func NewProjectFileParser() ProjectFileParser

func (ProjectFileParser) FindProjectFile added in v0.3.1

func (p ProjectFileParser) FindProjectFile(path string) (string, error)

func (ProjectFileParser) NPMIsRequired added in v0.0.122

func (p ProjectFileParser) NPMIsRequired(path string) (bool, error)

func (ProjectFileParser) NodeIsRequired added in v0.0.122

func (p ProjectFileParser) NodeIsRequired(path string) (bool, error)

func (ProjectFileParser) ParseVersion added in v0.9.0

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

type ProjectParser

type ProjectParser interface {
	FindProjectFile(root string) (string, error)
	ParseVersion(path string) (string, error)
	NodeIsRequired(path string) (bool, error)
	NPMIsRequired(path string) (bool, error)
}

type PublishProcess

type PublishProcess interface {
	Execute(workingDir, nugetCachePath, projectPath, outputPath string, debug bool, flags []string) error
}

type SBOMGenerator added in v0.10.0

type SBOMGenerator interface {
	Generate(dir string) (sbom.SBOM, error)
}

type Slicer added in v0.7.3

type Slicer interface {
	Slice(assetsFile string) (pkgs, earlyPkgs, projects packit.Slice, err error)
}

type SourceRemover added in v0.1.1

type SourceRemover interface {
	Remove(workingDir, publishOutputDir string, excludedFiles ...string) error
}

type SymlinkManager added in v0.6.0

type SymlinkManager interface {
	Link(oldname, newname string) error
	Unlink(path string) error
}

type Symlinker added in v0.6.0

type Symlinker struct{}

func NewSymlinker added in v0.6.0

func NewSymlinker() Symlinker
func (s Symlinker) Link(oldname, newname string) error
func (s Symlinker) Unlink(path string) error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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