package deploy
import "github.com/gohugoio/hugo/deploy"
Index ¶
- Variables
- func InvalidateCloudFront(ctx context.Context, target *Target) error
- func InvalidateGoogleCloudCDN(ctx context.Context, origin string) error
- type DeployConfig
- type Deployer
- func New(cfg config.AllProvider, logger loggers.Logger, localFs afero.Fs) (*Deployer, error)
- func (d *Deployer) Deploy(ctx context.Context) error
- type Matcher
- type Target
Variables ¶
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.
func InvalidateGoogleCloudCDN ¶
Invalidate all of the content in a Google Cloud CDN distribution.
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.
func New ¶
New constructs a new *Deployer.
func (*Deployer) Deploy ¶
Deploy deploys the site to a target.
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.
func (*Matcher) Matches ¶
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 }
Source Files ¶
cloudfront.go deploy.go deployConfig.go deploy_azure.go google.go
- Version
- v0.122.0
- Published
- Jan 26, 2024
- Platform
- windows/amd64
- Imports
- 37 packages
- Last checked
- 32 minutes ago –
Tools for package owners.