aviation-api
Version:
[](https://travis-ci.org/cristobal-io/aviation-api)
77 lines (59 loc) • 1.89 kB
Plain Text
SHELL = /bin/bash
MAKEFLAGS += --no-print-directory --silent
export PATH := ./node_modules/.bin:$(PATH):./bin
LINT_DEPS = $(wildcard *.js src/*.js test/*.js scrapers/*.js spikes/*.js test/*/*.js scrapers/*/*.js spikes/*/*.js)
default: setup dev
setup:
npm i
test: lint
mocha
test-docker: lint docker-dependencies
npm test || docker-compose stop
docker-compose stop
test-docker-watch: docker-dependencies
mocha -w || docker-compose stop
docker-compose stop
docker-dependencies:
docker-compose up -d db data geoip
docker-start-dev: docker-dependencies
npm run dev || docker-compose stop
docker-compose stop
dev: docker-dependencies
npm run watch:dev || docker-compose stop
docker-compose stop
# lint
lint: $(LINT_DEPS)
echo "Linting started..."
eslint $?
echo "Linting finished without errors"
lint-fix: $(LINT_DEPS)
eslint --fix $?
test-watch:
mocha -w
test-coverage-report:
echo "Generating coverage report, please stand by"
test -d node_modules/nyc/ || npm install nyc
nyc mocha && nyc report --reporter=html
open coverage/index.html
docs:
echo "generating docs..."
apidoc -i src/ -o apidoc/
echo "docs generated."
open-docs:
open apidoc/index.html
pages:
echo "generating docs..."
apidoc -i src/ -o ./
echo "docs generated."
echo
echo "next steps to use the files generated to update the gh-pages:"
echo "1. 'git status' to check that there are not modified files to be commited, only new files to add."
echo "2. 'git add .'"
echo "3. 'git stash' save the files for apply them later."
echo "4. 'git checkout gh-pages'"
echo "5. 'git status' to check that status is clean."
echo "6. 'git stash apply' "
echo "7. 'git stash drop'"
echo "8. 'git status' only the new files should appear."
echo "9. 'mv [new_file] [old_file]' this way we overwrite the old files with the new ones."
echo "10. when finished we can commit and push."