Skip to content
This repository has been archived by the owner on Feb 8, 2024. It is now read-only.

Commit

Permalink
Add a makefile for easier builds
Browse files Browse the repository at this point in the history
  • Loading branch information
VentGrey committed Jun 20, 2023
1 parent 239288d commit 6d02b20
Showing 1 changed file with 52 additions and 0 deletions.
52 changes: 52 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
# Variables
DOCKER_IMAGE_NAME=upvent_svelte
DOCKER_CONTAINER_NAME=upvent_svelte

# Generate a production build.
build:
npm install
npm run build

# Run this to start developing.
debug:
npm install
npm run dev

dev:
$(MAKE) debug

# Run this before pushing to git.
test_before_push:
npm install
npm run test
npm run check
npm run test:unit
npm run lint

# Run this to check that everything is ok while developing.
test:
npm install
npm run test

# Commands for running in containers

# Build docker image
docker-build:
npm install
npm run build
docker build -t $(DOCKER_IMAGE_NAME) .

# Run docker container
docker-run:
docker run -d -p 80:80 --name $(DOCKER_CONTAINER_NAME) $(DOCKER_IMAGE_NAME)

# Stop docker container
docker-stop:
docker stop $(DOCKER_CONTAINER_NAME)

# Remove docker container
docker-rm:
docker rm $(DOCKER_CONTAINER_NAME)

# PHONY targets
.PHONY: build debug test_before_push docker-build docker-run docker-stop docker-rm

0 comments on commit 6d02b20

Please sign in to comment.