packager

package
v0.0.0-...-814db2d Latest Latest
Warning

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

Go to latest
Published: Dec 1, 2021 License: Apache-2.0 Imports: 23 Imported by: 0

README

Installing the packager

go get github.com/cloudfoundry/libbuildpack
cd ~/go/src/github.com/cloudfoundry/libbuildpack && GO111MODULE=on go mod download
cd packager/buildpack-packager &&  GO111MODULE=on go install

How to regenerate bindata.go

Run go generate when you add, remove, or change the files in the scaffold directory.

This will generate a new bindata.go file, which you SHOULD commit to the repo. Both the scaffold directory that this file is created from and the file itself belong in the repo. Make changes directly to the scaffold directory and its files, not bindata.go.

For more on go-bindata: https://github.com/jteeuwen/go-bindata

Running tests

ginkgo -r

Documentation

Overview

Code generated for package packager by go-bindata DO NOT EDIT. (@generated) sources: scaffold/.envrc scaffold/.gitignore scaffold/README.md scaffold/VERSION scaffold/bin/compile scaffold/bin/detect scaffold/bin/finalize scaffold/bin/release scaffold/bin/supply scaffold/fixtures/.gitkeep scaffold/fixtures/simple_test/some_file.txt scaffold/manifest.yml scaffold/scripts/brats.sh scaffold/scripts/build.sh scaffold/scripts/install_go.sh scaffold/scripts/install_tools.sh scaffold/scripts/integration.sh scaffold/scripts/unit.sh scaffold/src/LANGUAGE/Gopkg.toml scaffold/src/LANGUAGE/finalize/_finalize.go scaffold/src/LANGUAGE/finalize/_finalize_suite_test.go scaffold/src/LANGUAGE/finalize/_finalize_test.go scaffold/src/LANGUAGE/finalize/cli/_cli_suite_test.go scaffold/src/LANGUAGE/finalize/cli/_main.go scaffold/src/LANGUAGE/hooks/_hooks_debug.go scaffold/src/LANGUAGE/hooks/_hooks_suite_test.go scaffold/src/LANGUAGE/integration/_integration_suite_test.go scaffold/src/LANGUAGE/integration/_simple_test.go scaffold/src/LANGUAGE/supply/_supply.go scaffold/src/LANGUAGE/supply/_supply_suite_test.go scaffold/src/LANGUAGE/supply/_supply_test.go scaffold/src/LANGUAGE/supply/cli/_cli_suite_test.go scaffold/src/LANGUAGE/supply/cli/_main.go scaffold/src/LANGUAGE/vendor/.gitkeep

Index

Constants

This section is empty.

Variables

View Source
var CacheDir = filepath.Join(os.Getenv("HOME"), ".buildpack-packager", "cache")
View Source
var Stdout, Stderr io.Writer = os.Stdout, os.Stderr

Functions

func Asset

func Asset(name string) ([]byte, error)

Asset loads and returns the asset for the given name. It returns an error if the asset could not be found or could not be loaded.

func AssetDir

func AssetDir(name string) ([]string, error)

AssetDir returns the file names below a certain directory embedded in the file by go-bindata. For example if you run go-bindata on data/... and data contains the following hierarchy:

data/
  foo.txt
  img/
    a.png
    b.png

then AssetDir("data") would return []string{"foo.txt", "img"} AssetDir("data/img") would return []string{"a.png", "b.png"} AssetDir("foo.txt") and AssetDir("notexist") would return an error AssetDir("") will return []string{"data"}.

func AssetInfo

func AssetInfo(name string) (os.FileInfo, error)

AssetInfo loads and returns the asset info for the given name. It returns an error if the asset could not be found or could not be loaded.

func AssetNames

func AssetNames() []string

AssetNames returns the names of the assets.

func CompileExtensionPackage

func CompileExtensionPackage(bpDir, version string, cached bool, stack string) (string, error)

func CopyDirectory

func CopyDirectory(srcDir string) (string, error)

func DownloadFromURI

func DownloadFromURI(uri, fileName string) error

func Envrc

func Envrc() (*asset, error)

func EnvrcBytes

func EnvrcBytes() ([]byte, error)

func Gitignore

func Gitignore() (*asset, error)

func GitignoreBytes

func GitignoreBytes() ([]byte, error)

func MustAsset

func MustAsset(name string) []byte

MustAsset is like Asset but panics when Asset would return an error. It simplifies safe initialization of global variables.

func OurRestoreAsset

func OurRestoreAsset(dir, name string, funcMap template.FuncMap, shas map[string]string, force bool) error

RestoreAsset restores an asset under the given directory

func OurRestoreAssets

func OurRestoreAssets(dir, name string, funcMap template.FuncMap, shas map[string]string, force bool) error

RestoreAssets restores an asset under the given directory recursively

func Package

func Package(bpDir, cacheDir, version, stack string, cached bool) (string, error)

func RestoreAsset

func RestoreAsset(dir, name string) error

RestoreAsset restores an asset under the given directory

func RestoreAssets

func RestoreAssets(dir, name string) error

RestoreAssets restores an asset under the given directory recursively

func Scaffold

func Scaffold(bpDir string, languageName string) error

TODO: maybe make scaffold into a struct and split up packager and scaffold if they don't share anything

func Summary

func Summary(bpDir string) (string, error)

func Upgrade

func Upgrade(bpDir string, force bool) error

func ZipFiles

func ZipFiles(filename string, files []File) error

Types

type Dependencies

type Dependencies []Dependency

func (Dependencies) Len

func (d Dependencies) Len() int

func (Dependencies) Less

func (d Dependencies) Less(i, j int) bool

func (Dependencies) Swap

func (d Dependencies) Swap(i, j int)

type Dependency

type Dependency struct {
	URI             string          `yaml:"uri"`
	File            string          `yaml:"file"`
	SHA256          string          `yaml:"sha256"`
	Name            string          `yaml:"name"`
	Version         string          `yaml:"version"`
	Stacks          []string        `yaml:"cf_stacks"`
	SubDependencies []SubDependency `yaml:"dependencies"`
}

type File

type File struct {
	Name, Path string
}

type Manifest

type Manifest struct {
	Language     string       `yaml:"language"`
	Stack        string       `yaml:"stack"`
	IncludeFiles []string     `yaml:"include_files"`
	PrePackage   string       `yaml:"pre_package"`
	Dependencies Dependencies `yaml:"dependencies"`
	Defaults     []struct {
		Name    string `yaml:"name"`
		Version string `yaml:"version"`
	} `yaml:"default_versions"`
}

type SubDependency

type SubDependency struct{ Name string }

Directories

Path Synopsis
fixtures

Jump to

Keyboard shortcuts

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