summaryrefslogtreecommitdiffhomepage
path: root/Makefile
diff options
context:
space:
mode:
authorAdin Scannell <ascannell@google.com>2020-04-27 22:24:58 -0700
committerAdin Scannell <ascannell@google.com>2020-05-06 14:15:18 -0700
commit508e25b6d6e9a81edb6ddf8738450b79898b446a (patch)
treea7f6105ac25c8a879ed880e477d89ec6b6eb1a24 /Makefile
parent8cb33ce5ded7d417710e7e749524b895deb20397 (diff)
Adapt website to use g3doc sources and bazel.
This adapts the merged website repository to use the image and bazel build framework. It explicitly avoids the container_image rules provided by bazel, opting instead to build with direct docker commands when necessary. The relevant build commands are incorporated into the top-level Makefile.
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile32
1 files changed, 32 insertions, 0 deletions
diff --git a/Makefile b/Makefile
index c56c6ed48..4ee55e56c 100644
--- a/Makefile
+++ b/Makefile
@@ -120,6 +120,38 @@ tests: ## Runs all local ptrace system call tests.
.PHONY: tests
##
+## Website & documentation helpers.
+##
+## The website is built from repository documentation and wrappers, using
+## using a locally-defined Docker image (see images/jekyll). The following
+## variables may be set when using website-push:
+## WEBSITE_IMAGE - The name of the container image.
+## WEBSITE_SERVICE - The backend service.
+## WEBSITE_PROJECT - The project id to use.
+## WEBSITE_REGION - The region to deploy to.
+##
+WEBSITE_IMAGE := gcr.io/gvisordev/gvisordev
+WEBSITE_SERVICE := gvisordev
+WEBSITE_PROJECT := gvisordev
+WEBSITE_REGION := us-central1
+
+website-build: load-jekyll ## Build the site image locally.
+ @$(MAKE) run TARGETS="//website:website"
+.PHONY: website-build
+
+website-server: website-build ## Run a local server for development.
+ @docker run -i -p 8080:8080 gvisor.dev/images/website
+.PHONY: website-server
+
+website-push: website-build ## Push a new image and update the service.
+ @docker tag gvisor.dev/images/website $(WEBSITE_IMAGE) && docker push $(WEBSITE_IMAGE)
+.PHONY: website-push
+
+website-deploy: website-push ## Deploy a new version of the website.
+ @gcloud run deploy $(WEBSITE_SERVICE) --platform=managed --region=$(WEBSITE_REGION) --project=$(WEBSITE_PROJECT) --image=$(WEBSITE_IMAGE)
+.PHONY: website-push
+
+##
## Development helpers and tooling.
##
## These targets faciliate local development by automatically