-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
52 lines (45 loc) · 1.55 KB
/
Copy pathMakefile
File metadata and controls
52 lines (45 loc) · 1.55 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
VERSION ?= $(error VERSION var is not set)
TEST_SERVER ?= $(error TEST_SERVER var is not set)
DOCKER_RELOAD ?= docker compose up -d --force-recreate
.PHONY: clean
clean:
make -C shared clean
make -C server clean
make -C client clean
make -C ui clean
.PHONY: package-all
package-all:
make -C shared publish
make -C server package
#make -C client build
make -C ui package
make -C ui package-proxy
.PHONY: check-version
check-version:
@echo "$(VERSION)" | grep -Eq '^v[0-9]+\.[0-9]+\.[0-9]+$$' || \
(echo "Error: VERSION must follow the pattern v[0-9]+.[0-9]+.[0-9]+, got: $(VERSION)"; exit 1)
@echo "Version $(VERSION) is valid"
.PHONY: check-status
check-status:
@if [ -n "$$(git status --porcelain)" ]; then \
echo "Error: Working directory is dirty. Commit or stash changes first."; \
exit 1; \
fi
.PHONY: release
release: check-status check-version
@echo "Preparing release $(VERSION)..."
git checkout main
git pull origin main
git tag $(VERSION)
git push origin $(VERSION)
@echo "✅ $(VERSION) pushed!"
.PHONY: push-test
push-test:
@echo "Pushing latest tags to $(TEST_SERVER)..."
docker save jackpfarrelly/location-history-server:latest | ssh $(TEST_SERVER) "docker load"
docker save jackpfarrelly/location-history-ui:latest | ssh $(TEST_SERVER) "docker load"
docker save jackpfarrelly/location-history-ui-proxy:latest | ssh $(TEST_SERVER) "docker load"
@echo "✅ Pushed!"
@echo "♻️ Recreating containers..."
ssh $(TEST_SERVER) "$(DOCKER_RELOAD) location-history-server location-history-ui location-history-ui-proxy"
@echo "✅ Deployed!"