mirror of
https://github.com/scratchfoundation/scratch-www.git
synced 2024-11-23 07:38:07 -05:00
ca10232498
1. Use md5 compare instead of string compare for determining presence of translation 2. Strip out whitespace before doing md5 compare
93 lines
1.9 KiB
Makefile
93 lines
1.9 KiB
Makefile
ESLINT=./node_modules/.bin/eslint
|
|
NODE=node
|
|
SASSLINT=./node_modules/.bin/sass-lint -v
|
|
TAP=./node_modules/.bin/tap
|
|
WATCH=./node_modules/.bin/watch
|
|
WEBPACK=./node_modules/.bin/webpack
|
|
|
|
# ------------------------------------
|
|
|
|
build:
|
|
@make clean
|
|
@make static
|
|
@make translations
|
|
@make webpack
|
|
|
|
clean:
|
|
rm -rf ./build
|
|
mkdir -p build
|
|
mkdir -p locales
|
|
|
|
|
|
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
|
|
|
|
static:
|
|
cp -a ./static/. ./build/
|
|
|
|
translations:
|
|
./src/scripts/buildLocales/build-locales locales/translations.json
|
|
|
|
webpack:
|
|
$(WEBPACK) --bail
|
|
|
|
# ------------------------------------
|
|
|
|
watch:
|
|
$(WATCH) "make clean && make static" ./static &
|
|
$(WEBPACK) -d --watch &
|
|
wait
|
|
|
|
stop:
|
|
-pkill -f "$(WEBPACK) -d --watch"
|
|
-pkill -f "$(WATCH) make clean && make static ./static"
|
|
-pkill -f "$(NODE) ./server/index.js"
|
|
|
|
start:
|
|
$(NODE) ./server/index.js
|
|
|
|
# ------------------------------------
|
|
|
|
test:
|
|
@make lint
|
|
@echo ""
|
|
@make unit
|
|
@echo ""
|
|
@make functional
|
|
@echo ""
|
|
@make integration
|
|
@echo ""
|
|
|
|
lint:
|
|
$(ESLINT) ./*.js
|
|
$(ESLINT) ./server/*.js
|
|
$(ESLINT) ./src/*.js
|
|
$(ESLINT) ./src/*.jsx
|
|
$(ESLINT) ./src/mixins/*.jsx
|
|
$(ESLINT) ./src/views/**/*.jsx
|
|
$(ESLINT) ./src/components/**/*.jsx
|
|
$(SASSLINT) ./src/*.scss
|
|
$(SASSLINT) ./src/views/**/*.scss
|
|
$(SASSLINT) ./src/components/**/*.scss
|
|
|
|
unit:
|
|
$(TAP) ./test/unit/*.js
|
|
|
|
functional:
|
|
$(TAP) ./test/functional/*.js
|
|
|
|
integration:
|
|
$(TAP) ./test/integration/*.js
|
|
|
|
# ------------------------------------
|
|
|
|
.PHONY: build clean deploy static translations webpack watch stop start test lint
|