Documentation
¶
Overview ¶
Package slugcmplr exposes functions to transform a source repository to a Heroku compatible tarball known as a "slug" via a set of Buildpacks.
Index ¶
- func Commit(dir string) (string, error)
- func UploadBlob(ctx context.Context, method, url, path string) error
- type BuildpackReference
- type CompileCmd
- type CompileResult
- type MetadataCmd
- type MetadataResult
- type Outputter
- type PrepareCmd
- type PrepareResult
- type ReleaseCmd
- type ReleaseInfo
- type StdOutputter
- type Tarball
- type UploadCmd
- type UploadResult
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type BuildpackReference ¶
BuildpackReference is a reference to a buildpack, containing its raw URL and Name.
type CompileCmd ¶
type CompileCmd struct { CacheDir string BuildDir string Stack string SourceVersion string Buildpacks []*buildpack.Buildpack }
CompileCmd wraps up all the information required to compile the contents of SourceDir into a deployable artifact/slug.
func (*CompileCmd) Execute ¶
func (c *CompileCmd) Execute(ctx context.Context, out Outputter) (*CompileResult, error)
Execute applies the buildpacks to the SourceDir in their specific order, before compressing the result of these applications into a GZipped Tar file within BuildDir.
type CompileResult ¶
type CompileResult struct { SlugPath string SlugChecksum string SourceVersion string Procfile processfile.Procfile DetectedBuildpack string Stack string }
CompileResult contains metadata about the result of Executing CompileCmd.
type MetadataCmd ¶
type MetadataCmd struct { Heroku *heroku.Service Application string SourceDir string BuildDir string }
MetadataCmd wraps up all the information required to fetch metadata require for compilation of application.
func (*MetadataCmd) Execute ¶
func (m *MetadataCmd) Execute(ctx context.Context, _ Outputter) (*MetadataResult, error)
Execute fetches the applications name, stack, buildpacks, and config variables. It will also resolve the current HEAD commit of the source to be compiled.
type MetadataResult ¶
type MetadataResult struct { ApplicationName string Stack string Buildpacks []*BuildpackReference ConfigVars map[string]string SourceVersion string }
MetadataResult contains the result of resolving metadata for an application.
type Outputter ¶
Outputter mimics the interface implemented by *cobra.Command to inject custom Stdout and Stderr streams, while also allowing control over the verbosity of output.
type PrepareCmd ¶
type PrepareCmd struct { SourceDir string BuildDir string ConfigVars map[string]string Buildpacks []*BuildpackReference }
PrepareCmd wraps up all the information required to prepare an application for slug compilation.
func (*PrepareCmd) Execute ¶
func (p *PrepareCmd) Execute(ctx context.Context, _ Outputter) (*PrepareResult, error)
Execute prepares an application for compilation by download all required buildpack, copying the source into the build directory, and writing out the application environment.
type PrepareResult ¶
PrepareResult contains the result of preparing, including the path to the base build directory and metadata about the downloaded buildpacks -- their order and paths.
type ReleaseCmd ¶
ReleaseCmd wraps up all the information required to release a slug that has been uploaded to a Heroku application.
func (*ReleaseCmd) Execute ¶
func (r *ReleaseCmd) Execute(ctx context.Context, _ Outputter) (*ReleaseInfo, error)
Execute will attempt to release a given slug to an application, returning the release ID and and OutputStreamURL, if there is one.
type ReleaseInfo ¶
ReleaseInfo contains the ID and OutputStreamURL of an attempted release.
type StdOutputter ¶
StdOutputter is an Outputter that will default to os.Stdout and os.Stderr.
func (*StdOutputter) ErrOrStderr ¶
func (o *StdOutputter) ErrOrStderr() io.Writer
ErrOrStderr returns either the configured Err, or os.Stderr if it is nil.
func (*StdOutputter) IsVerbose ¶
func (o *StdOutputter) IsVerbose() bool
IsVerbose returnes whether the StdOutputter is in Verbose mode.
func (*StdOutputter) OutOrStdout ¶
func (o *StdOutputter) OutOrStdout() io.Writer
OutOrStdout returns either the configured Out, or os.Stdout if it is nil.
type UploadCmd ¶
type UploadCmd struct { Heroku *heroku.Service Application string Checksum string Path string DetectedBuildpack string SourceVersion string Stack string ProcessTypes map[string]string }
UploadCmd wraps up all the information required to upload a slug to a particular Heroku application.
type UploadResult ¶
UploadResult returns metadata about the uploaded slug, so that it can be referred to or released later.
Source Files
¶
Directories
¶
Path | Synopsis |
---|---|
Package buildpack encapsulate downloading and running of Heroku buildpacks as described by the Buildpack API
|
Package buildpack encapsulate downloading and running of Heroku buildpacks as described by the Buildpack API |
cmd
|
|
slugcmplr
Package main is the entrypoint to the `slugcmplr` binary.
|
Package main is the entrypoint to the `slugcmplr` binary. |
Package processfile allows for reading, modifying, and writing Procfile format files.
|
Package processfile allows for reading, modifying, and writing Procfile format files. |
Package slugignore implements Heroku-like .slugignore functionality for a given directory.
|
Package slugignore implements Heroku-like .slugignore functionality for a given directory. |