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-11-09 11:40:36 -05:00
|
|
|
TAP=./node_modules/.bin/tap
|
2015-09-02 15:08:58 -04:00
|
|
|
WATCH=./node_modules/.bin/watch
|
|
|
|
WEBPACK=./node_modules/.bin/webpack
|
2015-11-19 15:09:27 -05:00
|
|
|
GIT_VERSION=$(shell git rev-parse --verify --short=5 HEAD 2> /dev/null)
|
|
|
|
GIT_VERSION?=$(WWW_VERSION)
|
|
|
|
GIT_MESSAGE=$(shell git log -1 --pretty=%s 2> /dev/null)
|
2015-09-02 15:08:58 -04:00
|
|
|
|
|
|
|
# ------------------------------------
|
|
|
|
|
|
|
|
build:
|
|
|
|
@make clean
|
2016-01-08 13:50:58 -05:00
|
|
|
@make translations
|
2015-09-02 15:08:58 -04:00
|
|
|
@make webpack
|
2015-11-20 11:06:59 -05:00
|
|
|
@make tag
|
2015-09-02 15:08:58 -04:00
|
|
|
|
|
|
|
clean:
|
2015-09-04 01:26:56 -04:00
|
|
|
rm -rf ./build
|
2016-01-06 14:09:32 -05:00
|
|
|
rm -rf ./intl
|
2015-09-02 15:08:58 -04:00
|
|
|
mkdir -p build
|
2016-01-06 14:09:32 -05:00
|
|
|
mkdir -p intl
|
2015-09-02 15:08:58 -04:00
|
|
|
|
2015-11-03 12:51:45 -05:00
|
|
|
|
|
|
|
deploy:
|
2015-11-19 15:10:20 -05:00
|
|
|
ifeq ($(shell grep "artifact: deploy.zip" .elasticbeanstalk/config.yml 2> /dev/null), )
|
2015-11-03 12:51:45 -05:00
|
|
|
@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
|
2015-11-19 15:09:27 -05:00
|
|
|
eb deploy -l $(GIT_VERSION) -m "$(GIT_MESSAGE)"
|
2015-11-03 12:51:45 -05:00
|
|
|
endif
|
|
|
|
|
2015-11-20 11:06:59 -05:00
|
|
|
tag:
|
|
|
|
echo $(GIT_VERSION) > ./build/version.txt
|
|
|
|
|
2015-10-15 23:01:58 -04:00
|
|
|
translations:
|
2016-01-06 14:09:32 -05:00
|
|
|
./bin/build-locales intl
|
2015-10-15 23:01:58 -04:00
|
|
|
|
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
|
|
|
|
2016-04-15 19:42:57 -04:00
|
|
|
configure-fastly:
|
|
|
|
$(NODE) ./bin/configure-fastly.js
|
|
|
|
|
2015-09-02 15:08:58 -04:00
|
|
|
# ------------------------------------
|
|
|
|
|
2015-09-09 16:24:50 -04:00
|
|
|
start:
|
2016-04-18 14:07:11 -04:00
|
|
|
$(NODE) ./dev-server/index.js
|
2015-09-09 16:24:50 -04:00
|
|
|
|
|
|
|
# ------------------------------------
|
|
|
|
|
2015-09-02 15:08:58 -04:00
|
|
|
test:
|
|
|
|
@make lint
|
2015-11-09 15:22:49 -05:00
|
|
|
@make build
|
2015-11-09 11:40:36 -05:00
|
|
|
@echo ""
|
2016-01-08 13:50:58 -05:00
|
|
|
@make unit
|
|
|
|
@echo ""
|
|
|
|
@make functional
|
|
|
|
@echo ""
|
2016-03-22 16:26:16 -04:00
|
|
|
@make localization
|
|
|
|
@echo ""
|
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/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-09 11:40:36 -05:00
|
|
|
unit:
|
|
|
|
$(TAP) ./test/unit/*.js
|
|
|
|
|
|
|
|
functional:
|
|
|
|
$(TAP) ./test/functional/*.js
|
|
|
|
|
|
|
|
integration:
|
|
|
|
$(TAP) ./test/integration/*.js
|
|
|
|
|
2016-03-22 16:26:16 -04:00
|
|
|
localization:
|
|
|
|
$(TAP) ./test/localization/*.js
|
|
|
|
|
2015-09-02 15:08:58 -04:00
|
|
|
# ------------------------------------
|
|
|
|
|
2015-11-20 11:06:59 -05:00
|
|
|
.PHONY: build clean deploy static tag translations webpack watch stop start test lint
|