summaryrefslogtreecommitdiffstats
path: root/deploy
AgeCommit message (Collapse)Author
2024-02-07Avoid impporting deploy from config when nodeploy tag is setBjørn Erik Pedersen
Test: ``` go list -tags nodeploy ./... | grep deploy ``` Fixes #12009
2024-01-31deploy: Fix CloudFront invalidation with AWS SDK2Bjørn Erik Pedersen
2024-01-31Upgrade to deploy to use AWS SDK V2Franky W
2024-01-28all: Run gofumpt -l -w .Bjørn Erik Pedersen
2024-01-27all: Rework page store, add a dynacache, improve partial rebuilds, and some ↵develop2024Bjørn Erik Pedersen
general spring cleaning There are some breaking changes in this commit, see #11455. Closes #11455 Closes #11549 This fixes a set of bugs (see issue list) and it is also paying some technical debt accumulated over the years. We now build with Staticcheck enabled in the CI build. The performance should be about the same as before for regular sized Hugo sites, but it should perform and scale much better to larger data sets, as objects that uses lots of memory (e.g. rendered Markdown, big JSON files read into maps with transform.Unmarshal etc.) will now get automatically garbage collected if needed. Performance on partial rebuilds when running the server in fast render mode should be the same, but the change detection should be much more accurate. A list of the notable new features: * A new dependency tracker that covers (almost) all of Hugo's API and is used to do fine grained partial rebuilds when running the server. * A new and simpler tree document store which allows fast lookups and prefix-walking in all dimensions (e.g. language) concurrently. * You can now configure an upper memory limit allowing for much larger data sets and/or running on lower specced PCs. We have lifted the "no resources in sub folders" restriction for branch bundles (e.g. sections). Memory Limit * Hugos will, by default, set aside a quarter of the total system memory, but you can set this via the OS environment variable HUGO_MEMORYLIMIT (in gigabytes). This is backed by a partitioned LRU cache used throughout Hugo. A cache that gets dynamically resized in low memory situations, allowing Go's Garbage Collector to free the memory. New Dependency Tracker: Hugo has had a rule based coarse grained approach to server rebuilds that has worked mostly pretty well, but there have been some surprises (e.g. stale content). This is now revamped with a new dependency tracker that can quickly calculate the delta given a changed resource (e.g. a content file, template, JS file etc.). This handles transitive relations, e.g. $page -> js.Build -> JS import, or $page1.Content -> render hook -> site.GetPage -> $page2.Title, or $page1.Content -> shortcode -> partial -> site.RegularPages -> $page2.Content -> shortcode ..., and should also handle changes to aggregated values (e.g. site.Lastmod) effectively. This covers all of Hugo's API with 2 known exceptions (a list that may not be fully exhaustive): Changes to files loaded with template func os.ReadFile may not be handled correctly. We recommend loading resources with resources.Get Changes to Hugo objects (e.g. Page) passed in the template context to lang.Translate may not be detected correctly. We recommend having simple i18n templates without too much data context passed in other than simple types such as strings and numbers. Note that the cachebuster configuration (when A changes then rebuild B) works well with the above, but we recommend that you revise that configuration, as it in most situations should not be needed. One example where it is still needed is with TailwindCSS and using changes to hugo_stats.json to trigger new CSS rebuilds. Document Store: Previously, a little simplified, we split the document store (where we store pages and resources) in a tree per language. This worked pretty well, but the structure made some operations harder than they needed to be. We have now restructured it into one Radix tree for all languages. Internally the language is considered to be a dimension of that tree, and the tree can be viewed in all dimensions concurrently. This makes some operations re. language simpler (e.g. finding translations is just a slice range), but the idea is that it should also be relatively inexpensive to add more dimensions if needed (e.g. role). Fixes #10169 Fixes #10364 Fixes #10482 Fixes #10630 Fixes #10656 Fixes #10694 Fixes #10918 Fixes #11262 Fixes #11439 Fixes #11453 Fixes #11457 Fixes #11466 Fixes #11540 Fixes #11551 Fixes #11556 Fixes #11654 Fixes #11661 Fixes #11663 Fixes #11664 Fixes #11669 Fixes #11671 Fixes #11807 Fixes #11808 Fixes #11809 Fixes #11815 Fixes #11840 Fixes #11853 Fixes #11860 Fixes #11883 Fixes #11904 Fixes #7388 Fixes #7425 Fixes #7436 Fixes #7544 Fixes #7882 Fixes #7960 Fixes #8255 Fixes #8307 Fixes #8863 Fixes #8927 Fixes #9192 Fixes #9324
2023-08-30deploy: Create AWS session for CloudFront invalidation via Go CDKMatt Brown
This allows the AWS credentials to be picked up from the configured target URL (like blob does) rather than the current behaviour of only relying on the defaults. Relying on the defaults here means having to specify credentials twice (once in the URL for the blob, once in the environment for this code path) when non-default AWS credentials are in used (e.g. via a profile).
2023-08-21deploy: Update InvalidateCloudFront to use Go CDK helperOleksandr Redko
2023-06-23Fix broken nodeploy setupBjørn Erik Pedersen
Fixes #11149
2023-06-18deploy: Fix deploy defaults for non-zero flag values (e.g. maxDeletes, ↵Bjørn Erik Pedersen
invalidateCDN) This was broken in the config rewrite in Hugo 0.112.0. The workaround is to be explicit about setting these flag values (even if just using the defaults), e.g.: ``` hugo deploy --invalidateCDN --maxDeletes 256 ``` Fixes #11127
2023-06-18Replace the old log setup, with structured logging etc.Bjørn Erik Pedersen
Fixes #11124
2023-05-16Create a struct with all of Hugo's config optionsBjørn Erik Pedersen
Primary motivation is documentation, but it will also hopefully simplify the code. Also, * Lower case the default output format names; this is in line with the custom ones (map keys) and how it's treated all the places. This avoids doing `stringds.EqualFold` everywhere. Closes #10896 Closes #10620
2023-03-07ensure we default to 10 correctlydavidejones
2023-03-07switch transfers to workersdavidejones
2023-03-07customize parallel transfer countdavidejones
2023-03-01Replace deprecated ioutil with io and osOleksandr Redko
https://pkg.go.dev/io/ioutil is deprecated since Go 1.16.
2022-06-06deps: Update to github.com/pelletier/go-toml/v2 v2.0.1Anthony Fok
2022-05-06Improve error messages, esp. when the server is runningBjørn Erik Pedersen
* Add file context to minifier errors when publishing * Misc fixes (see issues) * Allow custom server error template in layouts/server/error.html To get to this, this commit also cleans up and simplifies the code surrounding errors and files. This also removes the usage of `github.com/pkg/errors`, mostly because of https://github.com/pkg/errors/issues/223 -- but also because most of this is now built-in to Go. Fixes #9852 Fixes #9857 Fixes #9863
2022-04-05deploy: Set an MD5 attribute and use that if eTag not availableDavid Jones
During Hugo deploy when a remote MD5 is invalid (e.g due to multipart eTag) Hugo reads the entire remote file and calculates the MD5 again which can be slow. This commit updates the file upload so that it will also store an MD5 hash in the cloud provider's attributes. e.g in AWS this looks like x-amz-meta-md5chksum: 26fe392386a8123bf8956a16e08cb841.
2022-03-17all: gofmt -w -r 'interface{} -> any' .Bjørn Erik Pedersen
Updates #9687
2021-12-11Remove debug statementJoe Mooring
2021-12-01Check for empty deployment targets and matchersJoe Mooring
Fixes #9220
2021-06-14Misc config loading fixesBjørn Erik Pedersen
The main motivation behind this is simplicity and correctnes, but the new small config library is also faster: ``` BenchmarkDefaultConfigProvider/Viper-16 252418 4546 ns/op 2720 B/op 30 allocs/op BenchmarkDefaultConfigProvider/Custom-16 450756 2651 ns/op 1008 B/op 6 allocs/op ``` Fixes #8633 Fixes #8618 Fixes #8630 Updates #8591 Closes #6680 Closes #5192
2021-04-29deploy: Don't treat a NotFound response for Delete as a fatal error.Robert van Gent
2021-03-14media: Make Type comparableBjørn Erik Pedersen
So we can use it and output.Format as map key etc. This commit also fixes the media.Type implementation so it does not need to mutate itself to handle different suffixes for the same MIME type, e.g. jpg vs. jpeg. This means that there are no Suffix or FullSuffix on media.Type anymore. Fixes #8317 Fixes #8324
2020-12-03all: Format code with gofumptBjørn Erik Pedersen
See https://github.com/mvdan/gofumpt
2020-10-28deploy: Do not call CDN service invalidation when executing a dry run deploymentJosé Moreira
Currently, if cache invalidation is enabled when running `hugo deploy --dryRun` with , the deployer does not take the dry run flag into consideration and triggers CloudFront/GoogleCloudCDN cache invalidation if any of those services are configured. This change will instead print a feedback message if a dry run is in effect and quiet mode is not enabled. Fixes #7884
2020-10-23build: Allow optional "nodeploy" tag to exclude deploy command from binEric Hagman
Fixes #7826
2020-08-03Respect mediatypes for deploy satotake
Fixes #6861
2020-05-14deploy: Do not suppress .well-known/ directoryJohn Weldon
Deployments ignore directories with a leading `.`, but should not ignore certain well known 'hidden' directories like `.well-known/` Fixes #6691
2020-03-08deploy: Add include and exclude support for remoteDavid Jones
2020-02-27deploy: Implement include/exclude filters for deployRobert van Gent
Fixes #6922
2019-10-03deploy: Add ability to invalidate Google Cloud CDNGarret Kelly
2019-09-13deploy: Do not compile in Azure on SolarisFazal Majid
See #6324
2019-08-12tests: Convert from testify to quicktestBjørn Erik Pedersen
2019-08-10Fixed tautological error conditionsChristian Muehlhaeuser
Drop error & nil checks where the value can not have changed.
2019-06-08deploy: Default --target to the first deployment targetRobert van Gent
2019-05-31Drop dashes in http header matcher attributes; other changes from code reviewRobert van Gent
2019-05-30deploy: remove TODO comment about subfolders; handled by GoCDK blob URLsRobert van Gent
2019-05-09deploy: Add tests; fix WindowsRobert van Gent
2019-05-06deploy: Support configuration of upload orderRobert van Gent
2019-05-06deploy: Support invalidating a CloudFront CDN cacheRobert van Gent
2019-05-04deploy: compute MD5 by reading if List didn't provide oneRobert van Gent
2019-05-03Add a "deploy" commandRobert van Gent