Repository navigation
Expand file tree
/
Copy pathMakefile
More file actions
71 lines (61 loc) · 2.46 KB
/
Copy pathMakefile
File metadata and controls
71 lines (61 loc) · 2.46 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
.PHONY: dev dev-backend dev-frontend docker-build dckb dcktest publish bump-minor bump-patch
VERSION ?= $(shell tr -d '\n' < VERSION.txt)
LOCAL_IMAGE ?= videocms:local
DEV_FRONTEND_HOST ?= 127.0.0.1
DEV_FRONTEND_PORT ?= 3000
DEV_BACKEND_HOST ?= 127.0.0.1
DEV_BACKEND_PORT ?= 3001
DEV_BACKEND_URL ?= http://$(DEV_BACKEND_HOST):$(DEV_BACKEND_PORT)
DEV_PUBLIC_ORIGIN ?= http://$(DEV_FRONTEND_HOST):$(DEV_FRONTEND_PORT)
DEV_MEDIA_PATH ?= /videos/qualitys
# Stable, development-only key so credentials saved in the local dev database
# remain readable across restarts. Production must supply its own secret.
DEV_STORAGE_ENCRYPTION_KEY ?= $(if $(StorageEncryptionKey),$(StorageEncryptionKey),MDEyMzQ1Njc4OWFiY2RlZjAxMjM0NTY3ODlhYmNkZWY=)
dev:
@DEV_FRONTEND_HOST="$(DEV_FRONTEND_HOST)" \
DEV_FRONTEND_PORT="$(DEV_FRONTEND_PORT)" \
DEV_BACKEND_HOST="$(DEV_BACKEND_HOST)" \
DEV_BACKEND_PORT="$(DEV_BACKEND_PORT)" \
DEV_BACKEND_URL="$(DEV_BACKEND_URL)" \
DEV_PUBLIC_ORIGIN="$(DEV_PUBLIC_ORIGIN)" \
DEV_MEDIA_PATH="$(DEV_MEDIA_PATH)" \
DEV_STORAGE_ENCRYPTION_KEY="$(DEV_STORAGE_ENCRYPTION_KEY)" \
./scripts/dev.sh
dev-backend:
Host="$(DEV_BACKEND_HOST):$(DEV_BACKEND_PORT)" \
FolderVideoQualitysPub="$(DEV_MEDIA_PATH)" \
StorageEncryptionKey="$(DEV_STORAGE_ENCRYPTION_KEY)" \
go tool air serve:main
dev-frontend:
cd videocms-frontend && \
NUXT_PUBLIC_API_URL="/api" \
NUXT_PUBLIC_BASE_URL="$(DEV_PUBLIC_ORIGIN)" \
NUXT_DEV_BACKEND_URL="$(DEV_BACKEND_URL)" \
NUXT_DEV_MEDIA_PATH="$(DEV_MEDIA_PATH)" \
bun run dev --host "$(DEV_FRONTEND_HOST)" --port "$(DEV_FRONTEND_PORT)"
docker-build:
docker buildx build \
-f Dockerfile \
--platform linux/amd64 \
--build-arg VERSION=$(VERSION) \
--build-arg CHANNEL=local \
--build-arg DOCKER_IMAGE_TAG=$(LOCAL_IMAGE) \
-t $(LOCAL_IMAGE) \
--load \
.
dckb: docker-build
dcktest:
docker run --rm -it -p 3000:3000 $(LOCAL_IMAGE)
publish:
@echo "Publishing is handled by GitHub Actions from staging and master."
@exit 1
bump-minor:
@NEW_VERSION=$$(awk -F. '{print $$1"."$$2+1".0"}' VERSION.txt); \
echo "Bumping minor to $$NEW_VERSION"; \
printf "%s" "$$NEW_VERSION" > VERSION.txt; \
sed -i "s/var VERSION string = \".*\"/var VERSION string = \"$$NEW_VERSION\"/" config/config.go
bump-patch:
@NEW_VERSION=$$(awk -F. '{print $$1"."$$2"."$$3+1}' VERSION.txt); \
echo "Bumping patch to $$NEW_VERSION"; \
printf "%s" "$$NEW_VERSION" > VERSION.txt; \
sed -i "s/var VERSION string = \".*\"/var VERSION string = \"$$NEW_VERSION\"/" config/config.go