-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
57 lines (48 loc) · 1.15 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
# Makefile for SurvRNC
# Variables
PYTHON=python
PIP=pip
DOCKER=docker
DOCKER_IMAGE=survrnc:latest
# Default target
.PHONY: all
all: help
# Help target
.PHONY: help
help:
@echo "Usage:"
@echo " make <target>"
@echo ""
@echo "Targets:"
@echo " help Show this help message"
@echo " install Install dependencies"
@echo " setup-env Set up the development environment"
@echo " run-tests Run unit tests"
@echo " build Build the project"
@echo " build-docker Build the Docker image"
@echo " run-docker Run the Docker container"
# Install dependencies
.PHONY: install
install:
$(PIP) install -r requirements.txt
# Set up the development environment
.PHONY: setup-env
setup-env: install
$(PYTHON) -m venv venv
. venv/bin/activate
# Run unit tests
.PHONY: run-tests
run-tests:
$(PYTHON) -m unittest discover -s tests
# Build the project
.PHONY: build
build:
$(PYTHON) setup.py build
# Build the Docker image
.PHONY: build-docker
build-docker:
$(DOCKER) build -t $(DOCKER_IMAGE) .
# Run the Docker container
.PHONY: run-docker
run-docker:
$(DOCKER) run -p 80:80 $(DOCKER_IMAGE)