Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var DefaultConfig = DeployConfig{ Workers: 10, InvalidateCDN: true, MaxDeletes: 256, }
Functions ¶
func InvalidateCloudFront ¶
InvalidateCloudFront invalidates the CloudFront cache for distributionID. Uses AWS credentials config from the bucket URL.
Types ¶
type DeployConfig ¶
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 ¶
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.
type Matcher ¶
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.
type Target ¶
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 }
Click to show internal directories.
Click to hide internal directories.