1
\$\begingroup\$

I've got the following Makefile..

.PHONY: install install-prod clean

MODULE := ./node_modules/.bin
COMPOSE := docker-compose -f docker-compose.yml

install:
    @echo "--- Installing dependencies!"
    npm install

install-prod:
    @echo "--- Installing production dependencies!"
    npm install --only=production

build:
    @echo "--- Babelify-ing code!"
    npm run build

run:
    @echo "--- Building Docker and running app!"
    ${COMPOSE} up --build -d app

test:
    @echo "--- Running tests"
    npm run test

coverall:
    @echo "--- Running tests & reporting to Coverall!"
    npm run coverall

clear:
    @echo "--- Clearing everything!"
    ${COMPOSE} down

It's a simple one, but in essence, it wraps commands in a package.json and a docker-compose.yml for an express app so it makes calls in a CI Pipeline easier to understand and maintain.

Would love some feedback about whether it can be optimized, cleaner, or potentially smaller. Anything really :)

\$\endgroup\$

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Browse other questions tagged or ask your own question.