scratch-www/Makefile

79 lines
1.6 KiB
Makefile
Raw Normal View History

2015-09-02 15:08:58 -04:00
ESLINT=./node_modules/.bin/eslint
NODE=node
SASSLINT=./node_modules/.bin/sass-lint -v
TAP=./node_modules/.bin/tap
2015-09-02 15:08:58 -04:00
WATCH=./node_modules/.bin/watch
WEBPACK=./node_modules/.bin/webpack
# ------------------------------------
build:
@make clean
@make translations
2015-09-02 15:08:58 -04:00
@make webpack
clean:
rm -rf ./build
2015-09-02 15:08:58 -04:00
mkdir -p build
mkdir -p locales
2015-09-02 15:08:58 -04:00
deploy:
ifeq ($(shell grep "artifact: deploy.zip" .elasticbeanstalk/config.yml), )
@echo "You must configure elasticbeanstalk to deploy an artifact."
@echo "Add the following to your .elasticbeanstalk/config.yml"
@echo "deploy:\n artifact: deploy.zip"
else
@make build
git archive -o deploy.zip HEAD
zip -rv deploy.zip build
eb deploy -l $$(git rev-parse --verify --short=5 HEAD) -m "$$(git log -1 --pretty=%s)"
endif
translations:
./lib/bin/build-locales locales/translations.json
2015-09-02 15:08:58 -04:00
webpack:
$(WEBPACK) --bail
2015-09-02 15:08:58 -04:00
# ------------------------------------
2015-09-09 16:24:50 -04:00
start:
$(NODE) ./server/index.js
# ------------------------------------
2015-09-02 15:08:58 -04:00
test:
@make lint
@make build
@echo ""
@make unit
@echo ""
@make functional
@echo ""
2015-09-02 15:08:58 -04:00
lint:
2015-09-02 16:33:31 -04:00
$(ESLINT) ./*.js
$(ESLINT) ./server/*.js
$(ESLINT) ./src/*.js
$(ESLINT) ./src/*.jsx
$(ESLINT) ./src/mixins/*.jsx
$(ESLINT) ./src/views/**/*.jsx
$(ESLINT) ./src/components/**/*.jsx
2015-09-21 13:27:21 -04:00
$(SASSLINT) ./src/*.scss
$(SASSLINT) ./src/views/**/*.scss
$(SASSLINT) ./src/components/**/*.scss
2015-09-02 15:08:58 -04:00
unit:
$(TAP) ./test/unit/*.js
functional:
$(TAP) ./test/functional/*.js
integration:
$(TAP) ./test/integration/*.js
2015-09-02 15:08:58 -04:00
# ------------------------------------
.PHONY: build clean deploy static translations webpack watch stop start test lint