.PHONY: up test test-unit test-integration test-single fix-format

build:
	docker build -f ./container/Dockerfile -t pse .
up:
	sudo ifconfig lo0 alias 10.200.10.9
	./shell/sls_notifier_start.sh
	docker-compose up -d
down:
	docker-compose down
test:
	sudo ifconfig lo0 alias 10.200.10.9
	./shell/sls_notifier_start.sh
	docker-compose run --rm pse npm run test
test-commit:
	docker-compose run --rm pse npm run lint:check
	docker-compose run --rm pse npm run lint:duplicate
	docker-compose run --rm pse npm run test:unit
	docker-compose run --rm pse npm run test:coverage
test-unit:
	docker-compose run --rm pse npm run test:unit
test-coverage:
	docker-compose run --rm pse npm run test:coverage
test-functional:
	sudo ifconfig lo0 alias 10.200.10.9
	./shell/sls_notifier_start.sh
	docker-compose run --rm pse npm run test:functional
test-coverage-func:
	docker-compose run --rm pse npm run test:coverage-func
test-integration:
	sudo ifconfig lo0 alias 10.200.10.9
	./shell/sls_notifier_start.sh
	docker-compose run --rm pse npm run test:integration
test-single:
# TODO-KSH Implements this feature
	sudo ifconfig lo0 alias 10.200.10.9
	./shell/sls_notifier_start.sh
	echo "To be implemented"
lint-duplicate:
	docker-compose run --rm pse npm run lint:duplicate
lint-check:
	docker-compose run --rm pse npm run lint:check
lint-format:
	docker-compose run --rm pse npm run lint:format
deploy:
	sudo ifconfig lo0 alias 10.200.10.9
	./shell/sls_notifier_start.sh
	docker-compose run --rm pse npm run deploy
watch:
	sudo ifconfig lo0 alias 10.200.10.9
	./shell/sls_notifier_start.sh
	docker-compose run --rm --service-ports pse npm run watch
install:
	npm install
	rm -rf custom
	mkdir -p custom
	./shell/sls_schema_typings.sh
	rm -f ./node_modules/pidcrypt/rng.js
	rm -f ./node_modules/pidcrypt/jsbn.js
	cp ./.resources/pidcrypt/rng.js ./node_modules/pidcrypt/
	cp ./.resources/pidcrypt/jsbn.js ./node_modules/pidcrypt/
setup:
	make install && make build
