mirror of
https://github.com/open-policy-agent/opa.git
synced 2026-08-27 02:34:52 -06:00
164ea5c4f1
With more and more version appearing, the argument count passed to the
`npm run` call through the shell glob had increased, too -- to a point
where execution was impossible because it had reached a hard limit.
The obvious fix would have been to use `find [...] -exec cmd {} +` or
`find [...] -print0 | xargs -0 cmd`, however, since the npm call builds
another command line that's executed, we'd step over that limit again.
So instead, we'll now run the npm script on batches of 200 files. It's
below the maximum (unclear what it is, I haven't dug that deep), and
still fast enough (running it file-by-file takes 15+minutes).
Signed-off-by: Stephan Renatus <stephan.renatus@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 $*
|
|
|
|
.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
|