forked from 2600hz/kazoo
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* move ci to own include mk file * use order-only prereqs * remove old phony targets * fix some specs and arg order
- Loading branch information
1 parent
c60c173
commit 0646ac3
Showing
5 changed files
with
88 additions
and
64 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
.PHONY: ci ci-config ci-steps ci-pre ci-fmt ci-build ci-codechecks ci-docs ci-schemas ci-dialyze ci-release | ||
|
||
PIP2 := $(shell { command -v pip || command -v pip2; } 2>/dev/null) | ||
CI_DIR := $(CURDIR)/make | ||
CI_VALIDATOR := $(CI_DIR)/circleci | ||
CI_CONFIG := $(CURDIR)/.circleci/config.yml | ||
|
||
ci: ci-config ci-steps | ||
|
||
|
||
ci-config: $(CI_VALIDATOR) | ||
@$(CI_VALIDATOR) config validate -c $(CI_CONFIG) || (echo "$(CI_CONFIG):1:"; exit 1) | ||
|
||
# | $(CI_DIR): see https://www.gnu.org/software/make/manual/make.html#Prerequisite-Types | ||
# order-only-prereq | ||
# otherwise cURL will be run everytime | ||
$(CI_VALIDATOR): | $(CI_DIR) | ||
@curl -fLSs https://circle.ci/cli | DESTDIR="$(CI_DIR)" bash | ||
|
||
$(CI_DIR): | ||
@mkdir $(CI_DIR) | ||
|
||
ci-steps: ci-pre ci-fmt ci-build ci-codechecks ci-docs ci-schemas ci-dialyze ci-release | ||
@$(if $(git status --porcelain | wc -l), $(MAKE) ci-unstaged) | ||
|
||
ci-pre: | ||
ifneq ($(PIP2),) | ||
## needs root access | ||
@echo $(CHANGED) | ||
@$(PIP2) install --user --upgrade pip | ||
@$(PIP2) install --user PyYAML mkdocs pyembed-markdown jsonschema | ||
else | ||
$(error "pip/pip2 is not available, please install python2-pip package") | ||
endif | ||
|
||
ci-docs: | ||
@./scripts/state-of-docs.sh || true | ||
@$(ROOT)/scripts/state-of-edoc.escript | ||
@$(MAKE) apis | ||
@$(MAKE) docs | ||
|
||
ci-codechecks: | ||
@./scripts/code_checks.bash $(CHANGED) | ||
@$(MAKE) code_checks | ||
@$(MAKE) app_applications | ||
@./scripts/validate-js.sh $(find {core,applications}/*/priv/**/* -name *.json) | ||
|
||
ci-fmt: | ||
@$(MAKE) fmt | ||
@$(MAKE) elvis | ||
|
||
ci-build: | ||
@$(MAKE) clean clean-deps deps kazoo xref sup_completion | ||
|
||
ci-schemas: | ||
@$(MAKE) validate-schemas | ||
@$(if $(CHANGED_SWAGGER), $(MAKE) ci-swagger) | ||
|
||
ci-swagger: | ||
@-$(MAKE) validate-swagger | ||
|
||
ci-unstaged: | ||
echo Unstaged changes! | ||
git status --porcelain | ||
git --no-pager diff | ||
echo 'Maybe try `make apis` and see if that fixes anything ;)' | ||
exit 1 | ||
|
||
ci-dialyze: build-plt | ||
ci-dialyze: | ||
@TO_DIALYZE="$(CHANGED)" $(MAKE) dialyze-it | ||
|
||
ci-release: | ||
@$(MAKE) build-ci-release |