2015-09-02 15:08:58 -04:00
|
|
|
ESLINT=./node_modules/.bin/eslint
|
2015-09-04 01:26:56 -04:00
|
|
|
NODE=node
|
2015-10-20 12:48:32 -04:00
|
|
|
SASSLINT=./node_modules/.bin/sass-lint -v
|
2015-09-02 15:08:58 -04:00
|
|
|
WATCH=./node_modules/.bin/watch
|
|
|
|
WEBPACK=./node_modules/.bin/webpack
|
|
|
|
|
|
|
|
# ------------------------------------
|
|
|
|
|
|
|
|
build:
|
|
|
|
@make clean
|
|
|
|
@make static
|
2015-10-15 23:01:58 -04:00
|
|
|
@make translations
|
2015-09-02 15:08:58 -04:00
|
|
|
@make webpack
|
|
|
|
|
|
|
|
clean:
|
2015-09-04 01:26:56 -04:00
|
|
|
rm -rf ./build
|
2015-09-02 15:08:58 -04:00
|
|
|
mkdir -p build
|
2015-10-19 20:35:36 -04:00
|
|
|
mkdir -p locales
|
2015-09-02 15:08:58 -04:00
|
|
|
|
2015-11-03 12:51:45 -05: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
|
|
|
|
|
2015-09-02 15:08:58 -04:00
|
|
|
static:
|
|
|
|
cp -a ./static/. ./build/
|
|
|
|
|
2015-10-15 23:01:58 -04:00
|
|
|
translations:
|
|
|
|
./src/scripts/build-locales locales/translations.json
|
|
|
|
|
2015-09-02 15:08:58 -04:00
|
|
|
webpack:
|
2015-10-20 19:45:01 -04:00
|
|
|
$(WEBPACK) --bail
|
2015-09-02 15:08:58 -04:00
|
|
|
|
|
|
|
# ------------------------------------
|
|
|
|
|
2015-09-09 16:24:50 -04:00
|
|
|
watch:
|
|
|
|
$(WATCH) "make clean && make static" ./static &
|
|
|
|
$(WEBPACK) -d --watch &
|
|
|
|
wait
|
|
|
|
|
|
|
|
stop:
|
2015-10-08 18:21:39 -04:00
|
|
|
-pkill -f "$(WEBPACK) -d --watch"
|
|
|
|
-pkill -f "$(WATCH) make clean && make static ./static"
|
|
|
|
-pkill -f "$(NODE) ./server/index.js"
|
2015-09-09 16:24:50 -04:00
|
|
|
|
|
|
|
start:
|
|
|
|
$(NODE) ./server/index.js
|
|
|
|
|
|
|
|
# ------------------------------------
|
|
|
|
|
2015-09-02 15:08:58 -04:00
|
|
|
test:
|
|
|
|
@make lint
|
2015-10-20 19:45:01 -04:00
|
|
|
@make build
|
2015-09-02 15:08:58 -04:00
|
|
|
|
|
|
|
lint:
|
2015-09-02 16:33:31 -04:00
|
|
|
$(ESLINT) ./*.js
|
2015-09-04 01:26:56 -04:00
|
|
|
$(ESLINT) ./server/*.js
|
2015-09-24 18:13:30 -04:00
|
|
|
$(ESLINT) ./src/*.js
|
2015-09-02 17:40:14 -04:00
|
|
|
$(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
|
|
|
|
|
|
|
# ------------------------------------
|
|
|
|
|
2015-11-03 12:51:45 -05:00
|
|
|
.PHONY: build clean deploy static translations webpack watch stop start test lint
|