2019-11-01 23:48:59 +00:00
|
|
|
ci: build test-cover test-rules test-examples
|
|
|
|
|
|
|
|
local: build test-cover run-help
|
|
|
|
|
|
|
|
# run targets
|
|
|
|
run-help: ## print the help
|
|
|
|
@node out/index.js --help
|
|
|
|
|
|
|
|
run-stream: ## validate stdin and write it to stdout, errors to stderr
|
|
|
|
@node out/index.js \
|
|
|
|
--config-path $(ROOT_PATH)/docs \
|
|
|
|
--config-name config-stderr.yml \
|
|
|
|
--dest - \
|
|
|
|
--format yaml \
|
|
|
|
--rules $(ROOT_PATH)/rules/tsconfig.yml \
|
|
|
|
--source - \
|
|
|
|
--tag tsconfig
|
|
|
|
|
|
|
|
test-examples: ## run medium (feature) tests
|
|
|
|
$(SCRIPT_PATH)/test-examples.sh
|
|
|
|
|
|
|
|
test-rules: ## validate the rules directory
|
|
|
|
test-rules: build-bundle
|
|
|
|
find $(ROOT_PATH)/rules -maxdepth 1 -name '*.yml' | while read file; \
|
|
|
|
do \
|
|
|
|
echo "Validating $${file}..."; \
|
|
|
|
node out/index.js \
|
|
|
|
--config-path $(ROOT_PATH)/docs \
|
|
|
|
--config-name config-stderr.yml \
|
|
|
|
--rules $(ROOT_PATH)/rules/salty-dog.yml \
|
|
|
|
--source $${file} \
|
|
|
|
--tag salty-dog > /dev/null || exit 1; \
|
|
|
|
done
|
2019-11-02 02:27:18 +00:00
|
|
|
|
|
|
|
local-alpine:
|
|
|
|
docker run --rm -v "$(shell pwd):/salty-dog" -w /salty-dog node:11-stretch make ci
|
|
|
|
|
|
|
|
local-stretch:
|
2019-11-02 14:10:27 +00:00
|
|
|
docker run --rm -v "$(shell pwd):/salty-dog" -w /salty-dog node:11-alpine sh -c "apk add build-base git && make ci"
|
|
|
|
|
2019-11-02 14:20:30 +00:00
|
|
|
local-chown-leaks: ## clean up root-owned files the containers may leak
|
|
|
|
sudo chown -R ${USER}:${USER} $(ROOT_PATH)
|
|
|
|
|
2019-11-02 14:10:27 +00:00
|
|
|
full: ## ultra thorough build (looong)
|
|
|
|
$(MAKE) clean-target ci
|
2019-11-02 14:20:30 +00:00
|
|
|
$(MAKE) clean-target local-alpine local-chown-leaks
|
|
|
|
$(MAKE) clean-target local-stretch local-chown-leaks
|
2019-11-02 14:10:27 +00:00
|
|
|
$(MAKE) clean-target
|
2019-11-02 14:20:30 +00:00
|
|
|
@echo "Full build (CI, alpine, stretch) succeeded!"
|