eirinistaging

package module
v0.0.0-...-5391c12 Latest Latest
Warning

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

Go to latest
Published: Jan 29, 2021 License: Apache-2.0 Imports: 19 Imported by: 0

README

eirini-staging

eirini-staging is a process for building Droplets on Kubernetes. Three conainter images are created:

  • eirini/recipe-downloader: Downloads app-bits and buildpacks from the bits-service
  • eirini/recipe-executor: Executes the buildpackapplifecyle to build a Droplet
  • eirini/recipe-uploader: Uploads the Droplet to the bits-service

Documentation

Index

Constants

View Source
const (
	// Environment Variable Names.
	EnvDownloadURL                     = "DOWNLOAD_URL"
	EnvBuildpacks                      = "BUILDPACKS"
	EnvDropletUploadURL                = "DROPLET_UPLOAD_URL"
	EnvAppID                           = "APP_ID"
	EnvStagingGUID                     = "STAGING_GUID"
	EnvCompletionCallback              = "COMPLETION_CALLBACK"
	EnvCfUsername                      = "CF_USERNAME"
	EnvCfPassword                      = "CF_PASSWORD"
	EnvAPIAddress                      = "API_ADDRESS"
	EnvEiriniAddress                   = "EIRINI_ADDRESS"
	EnvCertsPath                       = "EIRINI_CERTS_PATH"
	EnvBuildpacksDir                   = "EIRINI_BUILDPACKS_DIR"
	EnvWorkspaceDir                    = "EIRINI_WORKSPACE_DIR"
	EnvOutputDropletLocation           = "EIRINI_OUTPUT_DROPLET_LOCATION"
	EnvOutputBuildArtifactsCache       = "EIRINI_OUTPUT_BUILD_ARTIFACTS_CACHE"
	EnvOutputMetadataLocation          = "EIRINI_OUTPUT_METADATA_LOCATION"
	EnvBuildArtifactsCacheDir          = "EIRINI_BUILD_ARTIFACTS_CACHE_DIR"
	EnvBuildpackCacheUploadURI         = "BUILDPACK_CACHE_UPLOAD_URI"
	EnvBuildpackCacheDownloadURI       = "BUILDPACK_CACHE_DOWNLOAD_URI"
	EnvBuildpackCacheChecksum          = "BUILDPACK_CACHE_CHECKSUM"
	EnvBuildpackCacheChecksumAlgorithm = "BUILDPACK_CACHE_CHECKSUM_ALGORITHM"

	RegisteredRoutes = "routes"

	AppBits                      = "app.zip"
	RecipeBuildPacksDir          = "/var/lib/buildpacks"
	RecipeBuildPacksName         = "recipe-buildpacks"
	RecipeWorkspaceDir           = "/recipe_workspace"
	RecipeWorkspaceName          = "recipe-workspace"
	RecipeOutputName             = "staging-output"
	RecipeOutputLocation         = "/out"
	RecipeOutputDropletLocation  = "/out/droplet.tgz"
	RecipeOutputMetadataLocation = "/out/result.json"

	CCUploaderInternalURL = "cc-uploader.service.cf.internal"

	CACertName = "internal-ca-cert"

	CCCertsMountPath = "/etc/config/certs"
	CCAPICertName    = "cc-server-crt"
	CCAPIKeyName     = "cc-server-crt-key"

	EiriniClientCert = "eirini-client-crt"
	EiriniClientKey  = "eirini-client-crt-key"
)

Variables

This section is empty.

Functions

func GitClone

func GitClone(repo url.URL, destination string) error

func OpenBuildpackURL

func OpenBuildpackURL(buildpackURL string, client *http.Client) ([]byte, error)

Types

type BuildpackManager

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

func (*BuildpackManager) Install

func (b *BuildpackManager) Install() error

type BuildpacksKeyModifier

type BuildpacksKeyModifier struct {
	CCBuildpacksJSON string
}

func (*BuildpacksKeyModifier) Modify

type Commander

type Commander interface {
	Exec(cmd string, args ...string) (int, error)
}

type DropletUploader

type DropletUploader struct {
	Client *http.Client
}

func (*DropletUploader) Upload

func (u *DropletUploader) Upload(
	dropletUploadURL string,
	dropletLocation string,
) error

type Executor

type Executor interface {
	ExecuteRecipe() error
}

type Extractor

type Extractor interface {
	Extract(src, targetDir string) error
}

type Installer

type Installer interface {
	Install() error
}

func NewBuildpackManager

func NewBuildpackManager(internalClient *http.Client, defaultClient *http.Client, buildpackDir, buildpacksJSON string) Installer

func NewPackageManager

func NewPackageManager(
	client *http.Client,
	downloadURL,
	downloadDir string,
	readerFrom ReaderFrom,
) Installer

type NotZipFileError

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

func (NotZipFileError) Error

func (z NotZipFileError) Error() string

type PackageInstaller

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

func (*PackageInstaller) Install

func (d *PackageInstaller) Install() error

type ReaderFrom

type ReaderFrom func(io.Reader) io.Reader

type Responder

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

func NewResponder

func NewResponder(stagingGUID, completionCallback, eiriniAddr, caCert, clientCrt, clientKey string) (Responder, error)

func (Responder) PrepareSuccessResponse

func (r Responder) PrepareSuccessResponse(outputLocation, buildpackCfg string) (*models.TaskCallbackResponse, error)

func (Responder) RespondWithFailure

func (r Responder) RespondWithFailure(failure error)

func (Responder) RespondWithSuccess

func (r Responder) RespondWithSuccess(resp *models.TaskCallbackResponse) error

type StagingResultModifier

type StagingResultModifier interface {
	Modify(result builder.StagingResult) (builder.StagingResult, error)
}

type Unzipper

type Unzipper struct {
	UnzippedSizeLimit int64
}

func (*Unzipper) Extract

func (u *Unzipper) Extract(src, targetDir string) error

type Uploader

type Uploader interface {
	Upload(path, url string) error
}

Directories

Path Synopsis
cmd
Code generated by counterfeiter.
Code generated by counterfeiter.
Code generated by counterfeiter.
Code generated by counterfeiter.
integration
integrationfakes
Code generated by counterfeiter.
Code generated by counterfeiter.

Jump to

Keyboard shortcuts

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