git

package module
v1.0.32 Latest Latest
Warning

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

Go to latest
Published: Jan 7, 2025 License: Apache-2.0 Imports: 9 Imported by: 0

README

Paketo Buildpack for Git

The Paketo Buildpack for Git is a Cloud Native Buildpack that retrieves git metadata and performs git operations.

Behavior

This buildpack uses the git dependency off of the stack that it is running on top of. The Git buildpack will only participate if there is a valid .git directory in the application source directory or if there a git-credentials service bindings present.

The buildpack will do the following:

  • Sets the REVISION environment variable, which is the commitish of HEAD, to be available for the build processes of other buildpacks and in the final running image.
  • Sets the org.opencontainers.image.revision label with the same commitish as the REVISION environment variable.
  • Creates custom git credential managers if it is provided with credentials through a binding.

Bindings

The buildpack optionally accepts the following bindings:

Type: git-credentials
Key Value Description
credentials <formated git credentials> The credentials file should have the following format to conform with the git credential structure.
context (optional) <url> The context is an optional pattern as defined by git. If a context is not provided then the credentials given in the binding will be the default credentials that git uses when authenticating. A given context can only be used once for any group of bindings, if a context is given by two separate bindings the build will fail.

Documentation

Index

Constants

View Source
const (
	// LayerNameGit is the name of the layer that is used to store git environment variables.
	LayerNameGit = "git"
)

Variables

This section is empty.

Functions

func Build

func Build(executable Executable, credentialManager CredentialManager, logger scribe.Emitter) packit.BuildFunc

func Detect

func Detect(bindingResolver BindingResolver) packit.DetectFunc

Types

type BindingResolver added in v0.4.0

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

type CredentialManager added in v0.4.0

type CredentialManager interface {
	Setup(workingDir, platformPath string) (err error)
}

type Executable

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

type GitCredentialManager added in v0.4.0

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

func NewGitCredentialManager added in v0.4.0

func NewGitCredentialManager(bindingResolver BindingResolver, executable Executable, logs scribe.Emitter) GitCredentialManager

func (GitCredentialManager) Setup added in v0.4.0

func (g GitCredentialManager) Setup(workingDir, platformDir string) error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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