deploy

package
v0.112.6 Latest Latest
Warning

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

Go to latest
Published: Jun 1, 2023 License: Apache-2.0 Imports: 36 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InvalidateCloudFront

func InvalidateCloudFront(ctx context.Context, distributionID string) error

InvalidateCloudFront invalidates the CloudFront cache for distributionID. It uses the default AWS credentials from the environment.

func InvalidateGoogleCloudCDN added in v0.59.0

func InvalidateGoogleCloudCDN(ctx context.Context, origin string) error

Invalidate all of the content in a Google Cloud CDN distribution.

Types

type DeployConfig added in v0.112.0

type DeployConfig struct {
	Targets  []*Target
	Matchers []*Matcher
	Order    []string

	// Usually set via flags.
	// Target deployment Name; defaults to the first one.
	Target string
	// Show a confirm prompt before deploying.
	Confirm bool
	// DryRun will try the deployment without any remote changes.
	DryRun bool
	// Force will re-upload all files.
	Force bool
	// Invalidate the CDN cache listed in the deployment target.
	InvalidateCDN bool
	// MaxDeletes is the maximum number of files to delete.
	MaxDeletes int
	// Number of concurrent workers to use when uploading files.
	Workers int
	// contains filtered or unexported fields
}

DeployConfig is the complete configuration for deployment.

func DecodeConfig added in v0.112.0

func DecodeConfig(cfg config.Provider) (DeployConfig, error)

DecodeConfig creates a config from a given Hugo configuration.

type Deployer

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

Deployer supports deploying the site to target cloud providers.

func New

func New(cfg config.AllProvider, localFs afero.Fs) (*Deployer, error)

New constructs a new *Deployer.

func (*Deployer) Deploy

func (d *Deployer) Deploy(ctx context.Context) error

Deploy deploys the site to a target.

type Matcher added in v0.112.0

type Matcher struct {
	// Pattern is the string pattern to match against paths.
	// Matching is done against paths converted to use / as the path separator.
	Pattern string

	// CacheControl specifies caching attributes to use when serving the blob.
	// https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control
	CacheControl string

	// ContentEncoding specifies the encoding used for the blob's content, if any.
	// https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Encoding
	ContentEncoding string

	// ContentType specifies the MIME type of the blob being written.
	// https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Type
	ContentType string

	// Gzip determines whether the file should be gzipped before upload.
	// If so, the ContentEncoding field will automatically be set to "gzip".
	Gzip bool

	// Force indicates that matching files should be re-uploaded. Useful when
	// other route-determined metadata (e.g., ContentType) has changed.
	Force bool
	// contains filtered or unexported fields
}

Matcher represents configuration to be applied to files whose paths match a specified pattern.

func (*Matcher) Matches added in v0.112.0

func (m *Matcher) Matches(path string) bool

type Target added in v0.112.0

type Target struct {
	Name string
	URL  string

	CloudFrontDistributionID string

	// GoogleCloudCDNOrigin specifies the Google Cloud project and CDN origin to
	// invalidate when deploying this target.  It is specified as <project>/<origin>.
	GoogleCloudCDNOrigin string

	// Optional patterns of files to include/exclude for this target.
	// Parsed using github.com/gobwas/glob.
	Include string
	Exclude string
	// contains filtered or unexported fields
}

Jump to

Keyboard shortcuts

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