-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathMakefile
More file actions
81 lines (59 loc) · 1.62 KB
/
Makefile
File metadata and controls
81 lines (59 loc) · 1.62 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
68
69
70
71
72
73
74
75
76
77
78
79
80
include app.env
export
FREEPDM=https://github.com/grd/FreePDM
BIN_DIR=${HOME}/bin
CONTAINER_NAME := freepdm
all: run createvault removevault test pdmserver gui
fpg:
go build -o $(BIN_DIR)/fpg ./apps/fpg/main.go
fpg-run:
go run ./apps/fpg/main.go
run:
air
createvault:
go build -o $(BIN_DIR)/createvault ./cmd/createvault
createvault
removevault:
go build -o $(BIN_DIR)/removevault ./cmd/removevault
removevault
test:
go test -failfast -v ./...
vaultstest:
go test -failfast internal/vault/localfs/vault_test.go
# go test internal/vault/localfs/vault_test.go
pdmserver:
go build -o $(BIN_DIR)/pdmserver ./cmd/pdmserver
pdmserver
# SQLite database clean-up
reset-db-sqlite:
rm -f $(SQLITE_PATH)
# PostgreSQL database clean-up
reset-db-postgres:
PGPASSWORD=$(PG_PASSWORD) dropdb -h $(PG_HOST) -U $(PG_USER) $(PG_DB)
PGPASSWORD=$(PG_PASSWORD) createdb -h $(PG_HOST) -U $(PG_USER) $(PG_DB)
# Stop interfering activities. Run `make docker` after this.
docker-up:
sudo systemctl stop postgresql
sudo systemctl stop smbd
# And restart the local interfering activities again.
local-up:
docker-compose down
sudo systemctl start postgresql
sudo systemctl start smbd
docker:
@$(MAKE) docker_stop
@$(MAKE) docker_start
docker_start:
@echo "Updating Docker containers..."
docker-compose pull --ignore-pull-failures
docker-compose up --build -d
@echo "Docker containers updated successfully."
docker_stop:
docker-compose down || true
docker_rm:
docker-compose down -v || true
docker rm -f ${CONTAINER_NAME} || true
docker_shell:
docker exec -it ${CONTAINER_NAME} /bin/sh
docker_logs:
docker logs ${CONTAINER_NAME}