Commit Graph

72 Commits (0e6751bf8e10e775b2dfaf1fdce75b439bb91171)

Author SHA1 Message Date
Tim Bannister 3724386042
When building for deploy, limit GOMAXPROCS
Copy the approach that we already use for Netlify deploy previews.

It would be OK to drop this once Golang is better able to work with
CFS, or if Hugo includes detection for the cgroup CPU limit.
2023-05-24 11:39:07 +01:00
Qiming Teng 68a455672c Use single CPU for building site preview
Based on some experiments, I am suspecting that there are some concurrency
issues when building the site for preview. In this PR, I'm proposing we
limit the CPUs to 1 (which is actually what Netlify provides us today).
The site preview build should normally complete within 4 minutes.
The chance of a successful build is much higher than the default setting.
2023-05-15 10:57:11 +08:00
Aravindh Puthiyaparambil a61f8b7035
Fix container-serve on SELinux systems
`make container-serve` fails with
"Error: open : no such file or directory" on SELinux enabled systems.
Fix this by adding the `ro,Z` suffix to the volume mount to label the
content with a read only private unshared label.
2023-03-21 08:07:01 -07:00
Davanum Srinivas 04708a1a83
Add DOCKER_BUILDX to inject path of buildx binary
Signed-off-by: Davanum Srinivas <davanum@gmail.com>
2022-12-05 22:59:52 -05:00
Davanum Srinivas 4d644b3486
print docker and buildx versions
Signed-off-by: Davanum Srinivas <davanum@gmail.com>
2022-12-05 08:21:12 -05:00
Davanum Srinivas 4e6a4b1b17
Build and push multi-arch images using docker buildx
Signed-off-by: Davanum Srinivas <davanum@gmail.com>
2022-12-03 19:50:31 -05:00
Patrice Chalin 7de0371183
Drop setting a default value for DEPLOY_PRIME_URL 2022-08-17 08:35:40 -04:00
Patrice Chalin 862c453f5a Makefile: add --cleanDestinationDir flag to hugo cmd invocations
Signed-off-by: Patrice Chalin <pchalin@gmail.com>
2022-08-16 15:29:38 -04:00
Tim Bannister cff1741971
Quote paths in Makefile
If there's a filename containing a space, this quoting helps the command
come out right.
2022-07-09 11:44:37 +01:00
Tim Bannister 100aff90d7
Don't lock source when building in a container
The container build process can work independently of the source, so no
locking is required.
(this also fixes unprivileged container builds)
2022-06-17 17:13:25 +01:00
Tim Bannister c7730937a4
Skip building a container image for local previews
Most of the time, you can pull the image from the internet.
2022-06-02 14:20:48 +01:00
cpanato eccf91164c
push the image when running the post cloudbuild job
Signed-off-by: cpanato <ctadeu@gmail.com>
2022-06-01 09:43:32 +02:00
Kubernetes Prow Robot a3e868c931
Merge pull request #31320 from rayw000/docs-for-module-check-and-module-init
Add help docs for module-check and module-init
2022-02-01 08:38:11 -08:00
Ray Wang 6c6288e41d
Add help docs for module-check and module-init
Now command `make` will show help docs for `module-check` and `module-init`
targets also.
2022-01-13 18:06:10 +08:00
Tim Bannister 2dfe0d1c30 Make only live website indexable
This change updates how we run Hugo AND changes the logic for checking
whether a page should be indexable (copied with a backport from upstream
Docsy).
2022-01-03 17:24:18 +00:00
Philippe Martin ba8c8d4238 Build with local assets 2021-08-04 22:22:33 +02:00
Kubernetes Prow Robot 304bf1bc53
Merge pull request #24387 from ameukam/container-image-build-automation
Add Container image build automation
2021-06-16 19:18:19 -07:00
Kubernetes Prow Robot 6852192fc4
Merge pull request #25326 from rayw000/makefile-update-submodules-before-serve
Add new make target `module-init` and update `module-check`
2021-06-08 19:01:47 -07:00
Kubernetes Prow Robot 80a91d7b6b
Merge pull request #27273 from sftim/20210328_restrict_privileges_local_preview
Run local container previews with minimal privileges
2021-04-24 18:41:00 -07:00
Philippe Martin ba0db04a8f New version of api-ref-generator submodule 2021-04-18 17:21:23 +02:00
Tim Bannister 6214d89445 Run local container previews with minimal privileges 2021-04-08 22:01:41 +01:00
Ray Wang 57f12c3660
Better module checking/initializing mechanism
1. Print a message to tell if modules need to be initialized when running `make serve` or other similar targets, and stop current make procedure.
2. Provide `module-init` target to initialize all dependencies

Co-authored-by: Tim Bannister <tim@scalefactory.com>
2021-02-22 16:21:43 +08:00
Kubernetes Prow Robot c42e56d811
Merge pull request #23294 from feloy/feloy-gsod-api-reference-ex1
[GSoD'20] Update how the Kubernetes website serves API references
2021-01-19 16:25:59 -08:00
Philippe Martin add24db3e3 New API Reference presentation on /content/en/docs/reference/kubernetes-api 2021-01-19 21:05:09 +01:00
TAKAHASHI Shuuji 4d44cd3ae1 Add comments for the commands in Makefile. 2020-11-05 21:02:21 +09:00
inductor 59d643b8a3 fix build 2020-11-01 11:01:10 +09:00
inductor 3f7f7f7b8e rebase master 2020-11-01 10:40:22 +09:00
Tim Bannister 25180022b1
Update local Hugo development target
- mount /tmp as tmpfs
- configure Hugo to use /tmp for all caches
- configure Hugo to render into /tmp
2020-10-10 18:07:35 +01:00
Arnaud Meukam 5eadf77b14
Add Container image build automation
As suggested by BenTheElder, we need to add a cloudbuild.yaml spec that
will be used by the prow job to automate the container build and push
the tags.

Signed-off-by: Arnaud Meukam <ameukam@gmail.com>
2020-10-06 00:42:07 +02:00
Tim Bannister bb04227f7b Run Hugo as user "hugo" in local dev container
When previewing locally using "make container-serve", run the Hugo
process as user "hugo" inside that container.
2020-10-03 04:10:33 +01:00
Benjamin Elder 7d62be1781 automatically derive image version 2020-07-22 11:04:09 -07:00
Benjamin Elder df7b5416e6 automatically tag docker image based on hugo version and dockerfile version 2020-07-16 23:28:19 -07:00
Benjamin Elder d6b3322ad0 fix container build
- install npm & postcss-cli in docker image
- match container build and non-container build hugo command
2020-07-15 12:21:01 -07:00
Kubernetes Prow Robot 63e787f946
Merge pull request #21782 from sftim/20200614_warn_if_submodules_not_initialized
Warn from make if submodules are not initialized
2020-06-29 11:47:59 -07:00
Tim Bannister 781b13b38d Warn from make if submodules are not initialized
If you forget to "git submodule update --init --recursive" before
running a local preview, the error from Hugo is cryptic. Add a more
helpful warning.
2020-06-24 22:13:10 +01:00
Emily Moss 3ab69bb5f1 fix on spaces 2020-06-24 12:11:06 -07:00
Roy Lenferink 58cd5ae880 Renamed docker-* targets to container-* and deprecated docker-* targets 2020-06-11 10:36:06 +02:00
Tim Bannister c00f694d7c Allow specifying container runtime for Makefile
This commit lets you run, eg:
DOCKER=podman make docker-image
DOCKER=podman make docker-serve

and spin up the website locally for testing, without using Docker or
needing to have Docker installed.
2020-06-07 15:36:44 +01:00
Kubernetes Prow Robot 5750f06822
Merge pull request #20606 from celestehorgan/linkchecker
Add a link checker to k8s.io
2020-05-27 06:16:41 -07:00
Tim Bannister 2eb6ab1ad3 Add a link checker
Signed-off-by: Celeste Horgan <celeste@cncf.io>
2020-05-26 16:06:46 -07:00
Tim Bannister 64e9ea7292 Serve rendered content from tmpfs for local dev
You can run:
 make docker-serve

to run Hugo in a container, building the site and then serving it.

Rather than write the rendered content into the repository for this,
set up a tmpfs and write the content there, then serve it.

This change is also compatible with podman.
2020-05-21 20:49:36 +01:00
Radoslaw Smigielski 26aa0d7e9b Make build of kubernetes-hugo image more reliable
Switch from default Docker bridge network to host network.
2020-04-08 22:25:08 +01:00
Jacky Wu 92e30010bd
cleanup: remove hugo-version-check.sh. (#18817) 2020-02-11 11:28:07 -08:00
Jacky Wu 6275183b59 refact: merge HUGO_VERSION, add deploy-preview. (#18020) 2020-01-15 04:47:33 -08:00
Jacky Wu 9a08775daf Fixed hot reload panic of local hugo issue. (#17894) 2019-12-03 23:06:57 -08:00
Zach Corleissen 41ea6d49fb Update master to Hugo version 0.57.2 (#16814)
Update Makefile for 0.57.2
2019-10-27 12:21:24 -07:00
Jim Angel fd53a95b51 Syncing release-branch 'test-example' change to master (#15137)
This is a preventative change that will allow release-1.15 to merge successfully.
2019-06-26 15:21:20 -07:00
Luc Perkins 654db85168 Use Hugo extended for Sass/CSS (#13113) 2019-06-09 06:31:07 -07:00
Jim Angel 4c172e0c85 Update Makefile (#14252) 2019-05-09 10:08:51 -07:00
Luc Perkins 8101de9f43 Remove Travis CI dependency (#13598)
* Remove Travis CI dependency

* Make scripts runnable via chmod

* Remove .travis.yml reference in test examples script
2019-04-11 01:40:13 -07:00