-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
67 lines (52 loc) · 1.54 KB
/
Makefile
File metadata and controls
67 lines (52 loc) · 1.54 KB
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
58
59
60
61
62
63
64
65
66
67
# =====================================
# Project: Hypervisor Monitoring App
# Organization: Hyperloop UPV
# Author: Javier Ribal del Río & Lola Castelló
# License: MIT
# =====================================
APP_NAME := hypervisor
RELEASE_DIR := release
FRONTEND_DIR := frontend
BACKEND_DIR := backend
.PHONY: build frontend backend prepare copy-config copy-frontend clean
build: frontend prepare backend copy-config copy-frontend
@echo "Release ready"
# -------------------------
# Frontend
# -------------------------
frontend:
@echo "Building frontend..."
cd $(FRONTEND_DIR) && npm install && npm run build
# -------------------------
# Prepare release folder
# -------------------------
prepare:
@echo "Preparing release folder..."
rm -rf $(RELEASE_DIR)
mkdir -p $(RELEASE_DIR)/frontend
# -------------------------
# Backend
# -------------------------
backend:
@echo "Building backend..."
cd $(BACKEND_DIR) && go build -o ../$(RELEASE_DIR)/$(APP_NAME) ./cmd
# -------------------------
# Copy config files
# -------------------------
copy-config:
@echo "Copying config..."
cp $(BACKEND_DIR)/cmd/config.toml $(RELEASE_DIR)/
cp $(BACKEND_DIR)/cmd/dev-config.toml $(RELEASE_DIR)/
cp $(BACKEND_DIR)/cmd/hypervisor-monitoring.json $(RELEASE_DIR)/
# -------------------------
# Copy frontend build
# -------------------------
copy-frontend:
@echo "Copying frontend..."
cp -r $(FRONTEND_DIR)/dist $(RELEASE_DIR)/frontend/
# -------------------------
# Clean
# -------------------------
clean:
rm -rf $(RELEASE_DIR)
rm -rf $(FRONTEND_DIR)/dist