You are on page 1of 1

davs://dbox.iti.upv.es/oc/remote.php/webdav/Programaci203enero3n/Makefile_nodejs.

ex
Página 1 de 1

current-dir := $(dir $(abspath $(lastword $(MAKEFILE_LIST))))

# ascii art for title


TITLE=""

.PHONY: help
help: ## Show this help.
@printf $(TITLE)
@printf "Usage:\n make [<target>...]\n\n"
@printf "Targets:\n"
@egrep '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN
{FS = ":.*?## "}; {printf "\033[36m%-20s\033[0m %s\n", $$1, $$2}'

.PHONY: build
build: npm/install start ## Install dependencies and start the server

npm/install: ACTION=install ## Install dependencies


npm/update: ACTION=update ## Update dependencies
npm/require: ACTION=install $(module) ## Add a dependency package, ej: install
module=foo
npm npm/install npm/update npm/require:
@docker run --rm $(INTERACTIVE) --volume $(current-dir):/app --user $
(id -u):$(id -g) \
node npm $(ACTION) --loglevel=warn

test: ## Execute tests


docker exec codelytv_ddd_skeleton-mooc_backend npm test
docker exec codelytv_ddd_skeleton-backoffice_backend npm test

# Docker Compose
start: CMD=up -d ## Start development server
stop: CMD=stop ## Stop development server
destroy: CMD=down ## Stop containers

doco start stop destroy:


@docker-compose $(CMD)

clean: ## Remove cache and temp. files


@rm -rf apps/*/*/var

You might also like