mirror of
https://github.com/open-policy-agent/opa.git
synced 2026-08-12 19:32:48 -06:00
1ebe25dd2f
This updates the Makefile targets to remove the hugo-only options for development, as well as clarifying/simplifying the requirements for a dev environment. There are now really two options: just look at the markdown preview with your editor/ide, or install the tools locally and deploy the full site. We can likely improve the dev experience some more (would be nice to get back to the live content updating dev experience) but for now this should help remove some confusion about how to build and run the site. Signed-off-by: Patrick East <east.patrick@gmail.com>
72 lines
1.7 KiB
Makefile
72 lines
1.7 KiB
Makefile
DEPLOY_PRIME_URL ?= "http://localhost:8888"
|
|
|
|
######################################################
|
|
#
|
|
# Development targets
|
|
#
|
|
######################################################
|
|
|
|
.PHONY: clean
|
|
clean:
|
|
rm -rf ${CURDIR}/website/data/releases.yaml
|
|
rm -rf $(CURDIR)/website/generated
|
|
rm -rf $(CURDIR)/website/public
|
|
rm -rf $(CURDIR)/website/resources
|
|
|
|
.PHONY: generate
|
|
generate:
|
|
$(CURDIR)/website/scripts/load-docs.sh
|
|
|
|
# The website has some npm dependencies saved in ./website/node_modules
|
|
# As well as dependencies required for the "live-blocks".
|
|
# Use this target to update them as needed.
|
|
.PHONY: install-deps
|
|
install-deps: live-blocks-install-deps
|
|
npm install
|
|
|
|
# The live-blocks-% pattern target will shim to the
|
|
# npm scripts in ./website/scripts/live-blocks
|
|
.PHONY: live-blocks-%
|
|
live-blocks-%:
|
|
cd $(CURDIR)/website/scripts/live-blocks && npm run --silent $*
|
|
|
|
.PHONY: serve-local
|
|
serve-local: production-build
|
|
# must be run from root of repo for
|
|
# the netlify.toml config to work
|
|
cd $(CURDIR)/.. && netlify dev --offline
|
|
|
|
.PHONY: serve-remote
|
|
serve-remote: production-build
|
|
# must be run from root of repo for
|
|
# the netlify.toml config to work
|
|
cd $(CURDIR)/.. && netlify deploy
|
|
|
|
######################################################
|
|
#
|
|
# CI targets
|
|
#
|
|
######################################################
|
|
|
|
.PHONY: hugo-production-build
|
|
hugo-production-build:
|
|
hugo \
|
|
--source $(CURDIR)/website \
|
|
--contentDir generated \
|
|
--ignoreCache \
|
|
--minify
|
|
|
|
.PHONY: production-build
|
|
production-build: clean generate hugo-production-build live-blocks-inject
|
|
|
|
.PHONY: preview-build
|
|
preview-build:
|
|
hugo \
|
|
--source $(CURDIR)/website \
|
|
--contentDir generated \
|
|
--baseURL $(DEPLOY_PRIME_URL) \
|
|
--buildDrafts \
|
|
--buildFuture \
|
|
--ignoreCache
|
|
make live-blocks-inject
|